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-10 of 12 results. Next

A048853 Number of primes (different from n) that can be produced by altering one digit of decimal expansion of n (without changing the number of digits).

Original entry on oeis.org

4, 3, 3, 4, 3, 4, 3, 4, 4, 4, 7, 4, 8, 4, 4, 4, 7, 4, 7, 2, 7, 2, 6, 2, 2, 2, 7, 2, 5, 2, 5, 2, 8, 2, 2, 2, 5, 2, 7, 3, 6, 3, 7, 3, 3, 3, 6, 3, 8, 2, 7, 2, 6, 2, 2, 2, 7, 2, 5, 2, 5, 2, 8, 2, 2, 2, 5, 2, 7, 3, 6, 3, 7, 3, 3, 3, 8, 3, 6, 2, 7, 2, 6, 2, 2, 2, 7, 2, 5, 1, 6, 1, 7, 1, 1, 1, 4, 1, 6, 4, 10, 4, 8, 4, 4
Offset: 1

Views

Author

Keywords

Comments

a(A192545(n)) = 0. - Reinhard Zumkeller, Jul 05 2011

Examples

			Altering the number 13 gives eight primes: 11, 17, 19, 23, 43, 53, 73, 83, so a(13)=8.
		

Crossrefs

Programs

  • Haskell
    import Data.List (inits, tails, nub)
    a048853 n = (sum $ map (a010051 . read) $ tail $ nub $ concat $ zipWith
      (\its tls -> map ((\xs ys d -> xs ++ (d:ys)) its tls) "0123456789")
        (map init $ tail $ inits $ show n) (tail $ tails $ show n)) - a010051 n
    -- Reinhard Zumkeller, Jul 05 2011
    
  • Maple
    A048853 := proc(n::integer) local resul,ddigs,d,c,tmp ; resul := 0 ; ddigs := convert(n,base,10) ; for d from 1 to nops(ddigs) do for c from 0 to 9 do if c = 0 and d = nops(ddigs) then continue ; else if c <> op(d,ddigs) then tmp := [op(1..d-1,ddigs),c,op(d+1..nops(ddigs),ddigs)] ; tst := sum(op(i,tmp)*10^(i-1),i=1..nops(tmp)) ; if isprime(tst) then resul := resul+1 ; fi ; fi ; fi ; od : od ; RETURN(resul) ; end: for n from 1 to 90 do printf("%d,",A048853(n)) ; od ; # R. J. Mathar, Apr 25 2006
  • Mathematica
    a[n_] := Module[{idn = IntegerDigits[n], id, np = 0}, Do[id = idn; If[ id[[j]] != k, id[[j]] = k; If[ id[[1]] != 0 && PrimeQ[ FromDigits[id]], np = np + 1]], {j, 1, Length[idn]}, {k, 0, 9}]; np]; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Dec 01 2011 *)
  • Python
    from sympy import isprime
    def h1(n): # hamming distance 1 neighbors of n, not starting with 0
        s = str(n); d = "0123456789"; L = len(s)
        yield from (int(s[:i]+c+s[i+1:]) for c in d for i in range(L) if c!=s[i] and not (i==0 and c=="0"))
    def a(n): return sum(1 for k in h1(n) if isprime(k))
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Jul 31 2022

A050662 a(n) is smallest number such that number of primes produced according to rules stipulated in Honaker's A048853 is n.

Original entry on oeis.org

90, 20, 2, 1, 29, 23, 11, 13, 117, 101, 107, 387, 177, 357, 1001, 4221, 10759, 11487, 42497, 42189, 317721, 984417, 344253, 1851759, 14040341, 15848679, 125367697, 139367847, 1044394659, 2214409197, 2909053719, 14485875423, 1167555543, 111738007953
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1999

Keywords

Comments

a(32) > 10^10. a(33) = 1167555543. a(34) > 10^10. - Donovan Johnson, May 08 2010
a(35) > 3*10^11. - Oscar Volpatti, Aug 06 2020

Crossrefs

Cf. A048853, first terms of A050652-A050661, A050673.

Programs

  • Maple
    A048853 := proc(n::integer) local resul,ddigs,d,c,tmp ; resul := 0 ; ddigs := convert(n,base,10) ; for d from 1 to nops(ddigs) do for c from 0 to 9 do if c = 0 and d = nops(ddigs) then continue ; else if c <> op(d,ddigs) then tmp := [op(1..d-1,ddigs),c,op(d+1..nops(ddigs),ddigs)] ; tst := sum(op(i,tmp)*10^(i-1),i=1..nops(tmp)) ; if isprime(tst) then resul := resul+1 ; fi ; fi ; fi ; od : od ; RETURN(resul) ; end: A050662 := proc(n::integer) local i; for i from 1 to 10000000 do if A048853(i) = n then RETURN(i) ; fi ; od ; RETURN(-1) ; end : for n from 1 to 90 do print(A050662(n)) ; od ; # R. J. Mathar, Apr 25 2006

Extensions

a(25)-a(31) and a(33) from Donovan Johnson, May 08 2010
a(32) and a(34) from Oscar Volpatti, Aug 06 2020

A050663 Primes p such that number of primes produced according to rules stipulated in Honaker's A048853 is 1.

Original entry on oeis.org

6983, 46769, 97039, 97919, 98519, 99721, 134129, 283961, 321187, 373229, 440497, 444623, 448519, 472261, 492839, 504991, 509557, 553919, 575009, 578923, 591937, 605707, 623107, 629339, 649559, 687847, 714037, 744019, 756011, 791081, 806671
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1999

Keywords

Examples

			Altering a(1)=6983 gives 1 prime: 6883.
		

Crossrefs

A050672 Primes p such that number of primes produced according to rules stipulated in Honaker's A048853 is 10.

Original entry on oeis.org

101, 139, 191, 409, 857, 977, 1009, 1013, 1019, 1031, 1049, 1069, 1091, 1231, 1409, 1429, 1451, 1481, 1487, 1493, 1523, 1667, 1733, 1753, 1787, 1789, 1831, 1877, 1879, 1931, 1933, 1999, 2069, 2111, 2243, 2287, 2293, 2351, 2381, 2417, 2447, 2477, 2539
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1999

Keywords

Examples

			Altering a(1)=101 gives 10 primes: 401, 601, 701, 131, 151, 181, 191, 103, 107 and 109.
		

Crossrefs

A050664 Primes p such that number of primes produced according to rules stipulated in Honaker's A048853 is 2.

Original entry on oeis.org

4409, 5077, 6841, 9199, 17863, 18637, 30817, 31477, 35279, 38557, 39953, 48527, 55871, 61441, 62137, 62459, 66359, 68023, 68087, 82997, 83579, 88951, 89329, 90437, 94117, 94343, 96329, 98981, 99643, 110753, 111857, 113453, 117307
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1999

Keywords

Examples

			Altering a(1)=4409 gives 2 primes: 1409 and 4909.
		

Crossrefs

A050665 Primes p such that number of primes produced according to rules stipulated in Honaker's A048853 is 3.

Original entry on oeis.org

2, 3, 5, 7, 929, 1117, 2459, 2819, 4111, 5189, 6427, 6959, 7561, 7841, 8849, 16741, 17053, 17761, 18089, 24659, 26119, 27329, 27689, 28843, 28933, 29243, 29311, 31601, 32621, 33107, 33289, 35977, 38273, 38431, 38959, 40361, 40471, 41467
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1999

Keywords

Examples

			Altering a(1)=2 gives 3 primes: 3, 5 and 7.
		

Crossrefs

A050666 Primes p such that number of primes produced according to rules stipulated in Honaker's A048853 is 4.

Original entry on oeis.org

97, 389, 659, 743, 953, 2423, 2971, 3037, 3083, 3593, 3727, 4177, 4363, 4813, 4889, 5261, 5519, 5717, 5813, 5939, 6197, 6449, 7001, 7057, 7331, 7963, 8123, 8179, 8353, 8501, 8707, 9293, 9587, 10247, 11261, 13147, 14813, 15263, 16547, 17573, 18077
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1999

Keywords

Examples

			Altering a(1)=97 gives 4 primes: 17, 37, 47 and 67.
		

Crossrefs

Programs

  • Mathematica
    A048853[n_] := Module[{idn = IntegerDigits[n], id, np = 0}, Do[id = idn; If[id[[j]] != k, id[[j]] = k; If[id[[1]] != 0 && PrimeQ[FromDigits[id]], np = np + 1]], {j, 1, Length[idn]}, {k, 0, 9}]; np]; Select[Table[{p, A048853[p]}, {p, Prime[Range[3000]]}], #[[2]] == 4&][[All,1]] (* Jean-François Alcover, May 09 2017 *)

A050667 Primes p such that number of primes produced according to rules stipulated in Honaker's A048853 is 5.

Original entry on oeis.org

29, 31, 37, 59, 61, 67, 89, 269, 331, 443, 487, 503, 521, 569, 571, 599, 733, 751, 761, 773, 811, 919, 983, 1291, 1303, 1319, 1511, 1567, 1777, 1847, 2179, 2473, 2579, 2633, 2671, 2707, 2927, 3299, 3449, 3797, 3847, 3877, 3943, 3989, 4139, 4339, 4561
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1999

Keywords

Examples

			Altering a(1)=29 gives 5 primes: 19, 59, 79, 89 and 23.
		

Crossrefs

A050668 Primes p such that number of primes produced according to rules stipulated in Honaker's A048853 is 6.

Original entry on oeis.org

23, 41, 47, 53, 71, 79, 83, 113, 149, 181, 229, 293, 311, 349, 359, 379, 421, 433, 523, 541, 587, 593, 617, 619, 661, 701, 719, 727, 769, 787, 797, 881, 971, 1327, 1373, 1399, 1471, 1543, 1741, 1747, 1811, 1889, 1913, 1979, 2027, 2129, 2137, 2161, 2251
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1999

Keywords

Examples

			Altering a(1)=23 gives 6 primes: 13, 43, 53, 73, 83 and 29.
		

Crossrefs

A050669 Primes p such that number of primes produced according to rules stipulated in Honaker's A048853 is 7.

Original entry on oeis.org

11, 17, 19, 43, 73, 151, 179, 211, 227, 233, 239, 241, 251, 271, 277, 281, 313, 353, 373, 457, 467, 479, 509, 547, 607, 631, 691, 809, 821, 839, 859, 863, 877, 911, 937, 941, 991, 1097, 1129, 1171, 1181, 1201, 1249, 1367, 1381, 1427, 1447, 1579, 1597
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1999

Keywords

Examples

			Altering a(1)=11 gives 7 primes: 31, 41, 61, 71, 13, 17 and 19.
		

Crossrefs

Showing 1-10 of 12 results. Next