login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A377164
a(n) is the least exponent k such that the binary representation of n occurs at exactly n positions within the binary representation of n^k, or -1 if this is not possible.
2
1, -1, 10, -1, 11, 30, 9, -1, 36, 51, 38, 80, 44, 70, 41, -1, 96, 97, 118, 203, 138, 123, 104, 321, 152, 202
OFFSET
1,3
COMMENTS
After a(27), which seems to be -1 (proof or counterexample needed), the sequence continues 258, 158, 185, 137, -1, 372, 374, 336, 505, 350, 435, 404, 876, 435, 365, 385, 657, 405, 540, 396, 1298, 465, 659, 488, 647, 482, 694, 557, 1049, 549, 725, 581, 861, 558, 638, 636, -1, ... .
EXAMPLE
Overlapping occurrences are counted.
a(3) = 10: 3 = 11_2, 3^10 = 59049 = 1110011010101001_2,
3 occurrences of 11_2: ^^ ^
a(5) = 11: 5 = 101_2, 5^11 = 48828125 = 10111010010000111011011101_2,
5 occurrences of 101_2: ^ ^ ^ ^ ^
a(7) = 9: 7 = 111_2, 7^9 = 40353607 = 10011001111011111101000111
7 occurrences of 111_2: ^^ ^^^^ ^
PROG
(PARI) findstr(m, n) = my(dm=digits(m, 2), dn=digits(n, 2)); sum(j=1, #dm-#dn+1, dn==dm[j..j+#dn-1]);
a377164(n) = if(n>1 && n==2^valuation(n, 2), -1, for(x=1, oo, if(findstr(n^x, n)==n, return(x))))
CROSSREFS
Cf. A377163.
Sequence in context: A370401 A172171 A327723 * A164899 A164844 A287015
KEYWORD
base,sign,more
AUTHOR
Hugo Pfoertner, Nov 01 2024
STATUS
approved