Puzzle: sequence without multiples of 3
|
09-13-2019, 07:05 PM
(This post was last modified: 09-13-2019 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) ? |
|||
09-13-2019, 08:57 PM
Post: #2
|
|||
|
|||
RE: Puzzle: sequence without multiples of 3 | |||
09-13-2019, 09:02 PM
Post: #3
|
|||
|
|||
RE: Puzzle: sequence without multiples of 3
f(10^6) = (3*333334-2)
k=333334 |
|||
09-13-2019, 09:43 PM
Post: #4
|
|||
|
|||
RE: Puzzle: sequence without multiples of 3 | |||
09-14-2019, 12:30 AM
(This post was last modified: 09-14-2019 12:39 AM by Thomas Okken.)
Post: #5
|
|||
|
|||
RE: Puzzle: sequence without multiples of 3
f(n) = floor((n-1)*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 |
|||
09-14-2019, 12:54 AM
(This post was last modified: 09-14-2019 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. |
|||
09-14-2019, 01:01 AM
(This post was last modified: 09-16-2019 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 non-squares sequence Code: F=n² 1 4 9 16 25 36 49 64 81 This assumed f is non-decreasing 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) |
|||
09-14-2019, 05:37 AM
Post: #8
|
|||
|
|||
RE: Puzzle: sequence without multiples of 3
INT((3*N-1)/2) for HP 38G.
|
|||
09-14-2019, 08:29 AM
(This post was last modified: 09-14-2019 06:46 PM by Albert Chan.)
Post: #9
|
|||
|
|||
RE: Puzzle: sequence without multiples of 3
Here is the HP-12C code that produce f(n), f(n) < 10^10
Code: Enter Enter Enter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)