login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A163496 a(n) = the number of distinct primes that can be made by writing n in binary, doubling any number (possibly zero) of 1's in place in this binary representation, and converting back to decimal. 1

%I #12 Jan 30 2020 18:42:36

%S 1,1,2,0,3,0,2,0,1,0,3,0,4,0,2,0,1,0,3,0,4,0,4,0,0,0,2,0,4,0,2,0,2,0,

%T 2,0,2,0,2,0,5,0,5,0,3,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,5,0,1,0,2,0,2,0,

%U 4,0,2,0,3,0,3,0,4,0,3,0,3,0,6,0,5,0,6,0,3,0,7,0,5,0,4,0,1,0,4,0,4,0,4,0,4

%N a(n) = the number of distinct primes that can be made by writing n in binary, doubling any number (possibly zero) of 1's in place in this binary representation, and converting back to decimal.

%C a(2n) = 0, for all n >= 2.

%H Antti Karttunen, <a href="/A163496/b163496.txt">Table of n, a(n) for n = 1..65537</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%e 13 in binary is 1101. The distinct binary numbers that can be made by doubling any number of 1's are: 1101 (13 in decimal), 11011 (doubling the rightmost 1, getting 27 in decimal), 11101 (29), 111101 (61), 111011 (59), and 1111011 (123). Of these, four are primes (13, 29, 61, 59). So a(13) = 4.

%o (PARI) A163496(n, x=0, w=0, z=1) = if(1==n, isprime(x+2^w)+z*isprime(x+3*(2^w)), if(!(n%2), A163496(n/2,x,w+1,1), A163496(n\2,x+(2^w),w+1,0)+if(z,A163496(n\2,x+3*(2^w),w+2,z),0))); \\ _Antti Karttunen_, Jan 30 2020

%K base,nonn,look

%O 1,3

%A _Leroy Quet_, Jul 29 2009

%E More terms from _Sean A. Irvine_, Oct 11 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 13:34 EDT 2024. Contains 371971 sequences. (Running on oeis4.)