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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Robert G. Wilson v, Apr 01 2005

Keywords

Comments

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

Examples

			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).
These two hexadecimal lines represent the primes between 10 and 1010:
  F5AE5AD52F 42B1A658F0 8758A5AC42 E0A3525529 18D52E1295
  0C0A25A25A 708E586489 1254A94221 8F10742E02 912A42A4A1
		

Crossrefs

Cf. A140891 (analog in base 14, prime = bit 0, remainder 1 = LSB), A140387 (analog in base 30, prime = bit 0, remainder 1 = LSB).

Programs

  • Mathematica
    f[n_] := FromDigits[ PrimeQ[ Drop[ Range[10n + 1, 10n + 9, 2], {3, 3}]] /. {True -> 1, False -> 0}, 2]; Table[ f[n], {n, 2, 93}]
    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 *)
    Table[FromDigits[Boole[PrimeQ[10n+{1,3,7,9}]],2],{n,0,100}] (* Harvey P. Dale, Nov 07 2016 *)
  • 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

Extensions

Edited by Don Reble, Nov 08 2005
Further edited by R. J. Mathar, Jun 18 2008
Further edited by N. J. A. Sloane, Aug 29 2008 at the suggestion of R. J. Mathar

A140891 Binary encoding of the prime-ness of the 6 integers r+14*n with remainder r=1, 3, 5, 9, 11 or 13.

Original entry on oeis.org

9, 49, 20, 42, 41, 20, 27, 33, 62, 10, 39, 21, 11, 39, 60, 30, 49, 28, 43, 41, 28, 31, 49, 55, 14, 53, 53, 42, 51, 29, 14, 51, 22, 58, 45, 22, 59, 57, 55, 46, 37, 29, 11, 43, 60, 14, 53, 60, 42, 59, 54, 27, 43, 54, 26, 61, 29, 15, 39, 28, 31, 49, 23, 58, 47, 54, 27, 53, 62, 42
Offset: 0

Views

Author

Juri-Stepan Gerasimov, Jul 07 2008

Keywords

Comments

Classify all integers 14n+r with r= 1, 3, 5, 9, 11 or 13 as nonprime or prime and assign hit positions 0=LSB, 1, 2, 3, 4, 5=MSB to the 6 remainders in the same order. Raise the bit if 14n+r is nonprime, erase it if 14n+r is prime.
The sequence interprets this as a number in base 2 and shows the decimal representation.

Examples

			For n=2, the 6 numbers 29 (r=1), 31 (r=3), 33 (r=5), 37 (r=9), 39 (r=11) and 41 (r=13) are prime, prime, nonprime, prime, nonprime, prime, which is rendered into the binary 001010 = 2^2+2^4=4+16=20=a(2).
		

Crossrefs

Cf. A105052 (analog in base 10, prime = bit 1, remainder 1 = MSB), A140387 (analog in base 30, prime = bit 0, remainder 1 = LSB).

Programs

  • Mathematica
    f[n_]:=FromDigits[1-Boole[PrimeQ[({13,11,9,5,3,1}+14n)]],2]; Table[f[n],{n,0,100}] (* Ray Chandler, Feb 20 2009 *)

Extensions

Corrected and extended by Ray Chandler, Feb 20 2009
Showing 1-2 of 2 results.