login
A161341
First differences of A161340.
2
1, 26, 56, 260, 56, 392, 392, 2192, 56, 392, 392, 2744, 392, 2744, 2744, 16952, 56, 392, 392, 2744, 392, 2744, 2744, 19208, 392, 2744, 2744, 19208, 2744, 19208, 19208, 125336, 56, 392, 392, 2744, 392, 2744, 2744, 19208, 392, 2744, 2744, 19208, 2744, 19208, 19208
OFFSET
1,2
FORMULA
a(n) = A160429(n) for n>1 and n not a power of 2.
a(n) = A160429(n) - 3n*(3n - 1) for n>1 and n a power of 2.
EXAMPLE
From Omar E. Pol, Mar 15 2020: (Start)
Written as an irregular triangle in which row lengths give A011782 the sequence begins:
1;
26;
56, 260;
56, 392, 392, 2192;
56, 392, 392, 2744, 392, 2744, 2744, 16952;
56, 392, 392, 2744, 392, 2744, 2744, 19208, 392, 2744, 2744, 19208, 2744, ...
(End)
PROG
(PARI) f(n) = 8*7^hammingweight(n-1); \\ A160429
ispow2(n) = my(k); (n==2) || (ispower(n, , &k) && (k==2));
a(n) = if (n==1, 1, if (ispow2(n), f(n) - 3*n*(3*n - 1), f(n))); \\ Michel Marcus, Mar 15 2020
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Omar E. Pol, Jun 14 2009
EXTENSIONS
Formula and more terms from Nathaniel Johnston, Nov 15 2010
More terms from Jinyuan Wang, Mar 14 2020
STATUS
approved