|
|
A056753
|
|
Only odd numbers occur and for all k there are k numbers between any two successive occurrences of k.
|
|
6
|
|
|
1, 3, 1, 5, 1, 3, 1, 7, 1, 3, 1, 9, 1, 3, 1, 7, 1, 3, 1, 11, 1, 3, 1, 7, 1, 3, 1, 13, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 17, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 19, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 21, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 23, 1, 3, 1, 7, 1, 3, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Only the numbers 2^m - 1 occur more than once.
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
a[n_] := a[n] = (ClearAll[f]; f[i_, x_, y_, z_] := f[i, x, y, z] = If[i == n, If[x == 1, a[n-z] + 2, a[n-z]], If[x == 1, If[y == 1, f[i+1, 2z, z, 2z], f[i+1, z, y-1, z]], f[i+1, x-1, y, z]]]; If[n == 0, 1, f[1, 1, 1, 1]]); Table[a[n], {n, 0, 98}] (* Jean-François Alcover, Dec 14 2011, after Reinhard Zumkeller *)
|
|
PROG
|
(PolyML)
let fun f(i, x, y, z) =
if i = n
then if x = 1
else if x = 1
then if y = 1
then f(i + 1, 2*z, z, 2*z)
else f(i + 1, z, y - 1, z)
else f(i + 1, x - 1, y, z)
in if n = 0
then 1
else f(1, 1, 1, 1)
end;
(Magma) S:=[ 0: n in [1..100] ]; k:=1; p:=Position(S, 0, 1); while p gt 0 do for j in [p..#S by k+1] do if S[j] eq 0 then S[j]:=k; else break; end if; end for; f:=p; p:=Position(S, 0, f); k+:=2; end while; S; // Klaus Brockhaus, Oct 25 2010
(Haskell)
import Data.List (intercalate, group)
a056753 n = a056753_list !! n
a056753_list = [1] ++ odds [] where
odds xs = xs ++ (intercalate xs' $ group [y+2, y+4..2*y+1]) ++ odds xs'
where y = 2 * length xs + 1
xs' = xs ++ [y] ++ xs
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
Claude Lenormand (claude.lenormand(AT)free.fr), Jan 19 2001
|
|
STATUS
|
approved
|
|
|
|