login
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
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
a(n) <= 1 for n <= 10^6. - Robert Israel, Jul 11 2018
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:
map(f, [$0..200]); # Robert Israel, Jul 11 2018
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
Cf. A018826.
Sequence in context: A339653 A255738 A296209 * A011751 A341540 A214507
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Oct 31 2002
STATUS
approved