Puzzle: sequence without multiples of 3

09132019, 07:05 PM
(This post was last modified: 09132019 09:44 PM by Albert Chan.)
Post: #1




Puzzle: sequence without multiples of 3
What is the simplest formula that can generate: 1,2, 4,5, 7,8, 10,11 ... ?
In other words, sequence never generate multiples of 3. f(1) = 1, f(2) = 2, f(3) = 4, f(4) = 5, f(5) = 7, f(6) = 8 ... What is f(10^6) ? 

09132019, 08:57 PM
Post: #2




RE: Puzzle: sequence without multiples of 3  
09132019, 09:02 PM
Post: #3




RE: Puzzle: sequence without multiples of 3
f(10^6) = (3*3333342)
k=333334 

09132019, 09:43 PM
Post: #4




RE: Puzzle: sequence without multiples of 3  
09142019, 12:30 AM
(This post was last modified: 09142019 12:39 AM by Thomas Okken.)
Post: #5




RE: Puzzle: sequence without multiples of 3
f(n) = floor((n1)*1.5)+1
This wouldn't be much of a puzzle if the most obvious formula happened to be the solution, but I thought I'd get it out of the way. As a baseline, if you will. UPDATE to add the answer to the second question: f(10^6) = 1,499,999 

09142019, 12:54 AM
(This post was last modified: 09142019 11:24 AM by John Keith.)
Post: #6




RE: Puzzle: sequence without multiples of 3
A simple program to generate the sequence, which is A001651:
Code:
Returns 2n+1 terms. Not much use to compute f(10^6) though. 

09142019, 01:01 AM
(This post was last modified: 09162019 08:13 PM by Albert Chan.)
Post: #7




RE: Puzzle: sequence without multiples of 3
Hi, Thomas Okken
You got it! I saw the formula from a book review, The Irrationals, by Julian Havil The formula itself is trivial, but the procedure to get it can be used for complicated sequences. Example: for nonsquares sequence Code: F=n² 1 4 9 16 25 36 49 64 81 This assumed f is nondecreasing function. f* is max k such that f(k) < n, thus we have 2x1, 4x2, 6x3, 8x4 ... → f*(n) = floor(√(n) + 0.5) → non_squares(n) = n + f* = n + floor(√(n) + 0.5) 

09142019, 05:37 AM
Post: #8




RE: Puzzle: sequence without multiples of 3
INT((3*N1)/2) for HP 38G.


09142019, 08:29 AM
(This post was last modified: 09142019 06:46 PM by Albert Chan.)
Post: #9




RE: Puzzle: sequence without multiples of 3
Here is the HP12C code that produce f(n), f(n) < 10^10
Code: Enter Enter Enter 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)