The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A105052 Write a(n) as a four-bit number; those bits state whether 10n+1, 10n+3, 10n+7 and 10n+9 are primes. 2

%I #25 Oct 19 2017 03:14:40

%S 6,15,5,10,14,5,10,13,5,2,15,4,2,11,1,10,6,5,8,15,0,8,7,5,8,10,5,10,

%T 12,4,2,14,0,10,3,5,2,5,5,2,9,1,8,13,5,2,14,1,2,9,5,0,12,0,10,2,5,10,

%U 2,5,10,7,0,8,14,5,8,6,4,8,9,1,2,5,4,10,9,4,2,2,1,8,15,1,0,7,4,2,14,0,2,9,1,2

%N Write a(n) as a four-bit number; those bits state whether 10n+1, 10n+3, 10n+7 and 10n+9 are primes.

%C Binary encoding of the prime-ness of the 4 integers r+10*n with remainder r=1, 3, 7 or 9. Classify the 4 integers 10n+r with r= 1, 3, 7, or 9, as nonprime or prime and associate bit positions 3=MSB,2,1,0=LSB with the 4 remainders in that order. Raise the bit if 10n+r is prime, erase it if 10n+r is nonprime. The sequence interprets the 4 bits as a number in base 2. a(n) is the decimal representation, obviously in the range 0<=a(n)<16. - _Juri-Stepan Gerasimov_, Jun 10 2008

%H Harvey P. Dale, <a href="/A105052/b105052.txt">Table of n, a(n) for n = 0..1000</a>

%e For n=2, the 4 numbers 21 (r=1), 23 (r=3), 27 (r=7), 29 (r=9) are nonprime, prime, nonprime, prime, which is rendered into 0101 = 2^0 + 2^2 = 5 = a(2).

%e These two hexadecimal lines represent the primes between 10 and 1010:

%e F5AE5AD52F 42B1A658F0 8758A5AC42 E0A3525529 18D52E1295

%e 0C0A25A25A 708E586489 1254A94221 8F10742E02 912A42A4A1

%t f[n_] := FromDigits[ PrimeQ[ Drop[ Range[10n + 1, 10n + 9, 2], {3, 3}]] /. {True -> 1, False -> 0}, 2]; Table[ f[n], {n, 2, 93}]

%t f[n_] := If[ GCD[n, 10] == 1, If[PrimeQ@ n, 1, 0], -1]; FromDigits[#, 2] & /@ Partition[ DeleteCases[ Array[f, 940], -1], 4] (* _Robert G. Wilson v_, Jun 22 2012 *)

%t Table[FromDigits[Boole[PrimeQ[10n+{1,3,7,9}]],2],{n,0,100}] (* _Harvey P. Dale_, Nov 07 2016 *)

%o (PARI) f(n)={s=0;if(isprime(10*n+1),s+=8);if(isprime(10*n+3), s+= 4);if(isprime(10*n+7),s+=2);if(isprime(10*n+9),s+=1); return(s)};for(n=0,93,print1(f(n),", ")) \\ _Washington Bomfim_, Jan 18 2011

%Y Cf. A000040, A007652, A010051.

%Y Cf. A030430, A030431, A030432, A030433.

%K base,nonn,easy

%O 0,1

%A _Robert G. Wilson v_, Apr 01 2005

%E Edited by _Don Reble_, Nov 08 2005

%E Further edited by _R. J. Mathar_, Jun 18 2008

%E Further edited by _N. J. A. Sloane_, Aug 29 2008 at the suggestion of _R. J. Mathar_

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 June 7 17:05 EDT 2024. Contains 373203 sequences. (Running on oeis4.)