|
|
A076141
|
|
Number of times n occurs as a binary sub-pattern of n^2.
|
|
2
|
|
|
1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
a(A018826(n))>0; is a(n)<=1 for all n?
Not multiplicative: a(5) = 0, a(29) = 0, a(145) = 1. - David W. Wilson, Jun 10 2005
|
|
LINKS
|
|
|
EXAMPLE
|
a(27) = 1 as 27 = '11011' occurs in 27^2=729 = '1011011001' once: '**11011***'.
|
|
MAPLE
|
f:= proc(n) local S, S2;
S:= convert(convert(n, binary), string);
S2:= convert(convert(n^2, binary), string);
nops([StringTools:-SearchAll(S, S2)])
end proc:
|
|
PROG
|
(PARI) issub(b, bs, k) = {for (i=1, #b, if (b[i] != bs[i+k-1], return (0)); ); return (1); }
a(n) = {if (n, b = binary(n), b = [0]); if (n, bs = binary(n^2), bs = [0]); sum(k=1, #bs - #b +1, issub(b, bs, k)); } \\ Michel Marcus, Mar 15 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|