cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A245470 Smallest multiple of n such that, when expressed in binary, in the string of bits the binary representation of n occurs after the n-1 most significant bits.

This page as a plain text file.
%I A245470 #20 Jul 26 2014 14:03:21
%S A245470 1,6,15,36,85,150,287,1032,2169,4170,8283,16428,32877,65646,131295,
%T A245470 524304,1048849,2097234,4194611,8388660,16777845,33554774,67109239,
%U A245470 134217816,268436025,536871322,1073742075,2147483772,4294967773,8589935070,17179869695,68719476768,137438955489,274877908002,549755814755,1099511627940
%N A245470 Smallest multiple of n such that, when expressed in binary, in the string of bits the binary representation of n occurs after the n-1 most significant bits.
%C A245470 For n>1, let d be the number of bits in n, and n' = n/gcd(n,2^d) = n/2^valuation(n,2) = A000265(n). Then a(n) = (2^{n-2}+mod(-(2^{n-2}),n')) * 2^d + n. (The mod function used here always returns a nonnegative result; e.g. mod(-2,7) = 5.) The alternative to use n/p^valuation(n,p) instead of gcd(n,p^d) works in any prime base p.
%C A245470 The word "after" in the definition can be interpreted as either "immediately after" or "at some point after" - the resulting sequence is the same.
%e A245470 a(4) = 36 = 100100_2; 100, the binary representation of 4, occurs after 4-1 = 3 bits.
%o A245470 (PARI) numbit(n)=my(r=1); while(n>=2, n\=2; r++); r a(n) = my(k, m); if(n<=1, n, k=2^numbit(n); m=2^(n-2); (-m%(n\gcd(n,k))+m)*k+n) \\ Could use 2^valuation(n,2) instead of gcd(n,k).
%Y A245470 Cf. A079847, A000265.
%K A245470 nonn,base
%O A245470 1,2
%A A245470 _Franklin T. Adams-Watters_, Jul 25 2014