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 21 results. Next

A182781 Number of n-digit terms in A048398.

Original entry on oeis.org

4, 4, 2, 1, 12, 20, 35, 28, 80, 114, 211, 228, 736, 1214, 2101, 2536, 7799, 13830, 22107, 27265, 82611, 144324, 259260, 354029, 901774, 1651718, 2913981, 3913728, 11048656, 19782855, 33483206, 49533124
Offset: 1

Views

Author

Zak Seidov, Feb 01 2011

Keywords

Comments

Also, number of n-digit primes in A033075.
Appears to be strictly increasing for n >= 8. - Chai Wah Wu, May 31 2017

Crossrefs

Programs

  • Maple
    A182781aux := proc(Lhig,n) local lsb,a ; if n = 0 then if isprime(Lhig) then    1; else 0; end if; else a := 0 ; lsb := Lhig mod 10 ; if lsb > 0 then a := a + procname(10*Lhig+lsb-1,n-1) ; end if; if lsb < 9 then a := a + procname(10*Lhig+lsb+1,n-1) ; end if; a; end if; end proc:
    A182781 := proc(n) if n = 1 then 4; else a := 0 ; for l from 1 to 9 do a := a + A182781aux(l,n-1) ; end do: a ; end if; end proc: # R. J. Mathar, Feb 01 2011

Extensions

a(22)-a(24) from Chai Wah Wu, May 31 2017
a(25)-a(32) from Chai Wah Wu, Jun 05 2017

A185893 Terms in A048398 ending with 1.

Original entry on oeis.org

101, 12101, 32321, 210101, 432121, 1012321, 1212121, 3210101, 3210121, 3212101, 3232321, 3432101, 5432321, 5434321, 21212101, 21232121, 23210101, 23232101, 43432321, 45434321, 101012321, 101210101, 101232121, 121232101, 123210121, 123232121, 321012121
Offset: 1

Views

Author

Zak Seidov, Feb 05 2011

Keywords

Comments

Among first 114956 terms, number of n-digit terms are: 0, 0, 1, 0, 2, 2, 9, 6, 22, 23, 32, 57, 166, 246, 382, 572, 1770, 2936, 3956, 6183, 18132, 30818, 49641.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[100000]], IntegerDigits[#][[-1]] == 1 && Union[Abs[Differences[IntegerDigits[#]]]] == {1} &]

A033075 Positive numbers all of whose pairs of consecutive decimal digits differ by 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 21, 23, 32, 34, 43, 45, 54, 56, 65, 67, 76, 78, 87, 89, 98, 101, 121, 123, 210, 212, 232, 234, 321, 323, 343, 345, 432, 434, 454, 456, 543, 545, 565, 567, 654, 656, 676, 678, 765, 767, 787, 789, 876
Offset: 1

Views

Author

Keywords

Comments

Number of n-digit terms: 9, 17, 32, 61, 116, 222, 424 (= A090994).
Also called 10-esthetic numbers (where in general a q-esthetic number has the property that the consecutive digits of its base-q representation differ by 1, see "Esthetic numbers" by J. M. De Koninck and N. Doyon). - Narad Rampersad, Aug 03 2018

Crossrefs

Cf. A090994, A048398 (primes), A048411 (squares), A207954 (palindromes).

Programs

  • Haskell
    -- import Data.Set (fromList, deleteFindMin, insert)
    a033075 n = a033075_list !! (n-1)
    a033075_list = f (fromList [1..9]) where
       f s | d == 0    = m : f (insert (10*m+1) s')
           | d == 9    = m : f (insert (10*m+8) s')
           | otherwise = m : f (insert (10*m+d-1) (insert (10*m+d+1) s'))
           where (m,s') = deleteFindMin s
                 d = mod m 10
    -- Reinhard Zumkeller, Feb 21 2012
    
  • Mathematica
    Join[Range[9],Select[Range[2000],Union[Abs[Differences[IntegerDigits[#]]]]=={1}&]] (* Harvey P. Dale, Dec 28 2011 *)
  • PARI
    diff(v)=vector(#v-1,i,v[i+1]-v[i])
    is(n)=if(n>9, Set(abs(diff(digits(n))))==[1], n>0) \\ Charles R Greathouse IV, Mar 11 2014
    
  • Python
    def ok(n):
        s = str(n)
        return all(abs(int(s[i]) - int(s[i+1])) == 1 for i in range(len(s)-1))
    print(list(filter(ok, range(1, 877)))) # Michael S. Branicky, Aug 22 2021
    
  • Python
    # faster version for initial segment of sequence
    def gen(d, s=None): # generate remaining d digits, from start digit s
        if d == 0:
            yield tuple()
            return
        if s == None:
            yield from [(i, ) + g for i in range(1, 10) for g in gen(d-1, s=i)]
        else:
            if s > 0:
                yield from [(s-1, ) + g for g in gen(d-1, s=s-1)]
            if s < 9:
                yield from [(s+1, ) + g for g in gen(d-1, s=s+1)]
    def agentod(digits):
        for d in range(1, digits+1):
            yield from [int("".join(map(str, g))) for g in gen(d, s=None)]
    print(list(agentod(11))) # Michael S. Branicky, Aug 22 2021

Formula

a(n) >> n^3.53267..., where the exponent is log 10/log k and k is the largest root of x^5 - x^4 - 4x^3 + 3x^2 + 3x - 1. - Charles R Greathouse IV, Mar 11 2014

A006055 Primes with consecutive (ascending) digits.

Original entry on oeis.org

2, 3, 5, 7, 23, 67, 89, 4567, 78901, 678901, 23456789, 45678901, 9012345678901, 789012345678901, 56789012345678901234567890123, 90123456789012345678901234567, 678901234567890123456789012345678901
Offset: 1

Views

Author

N. J. A. Sloane, Richard C. Schroeppel

Keywords

References

  • J. S. Madachy, Consecutive-digit primes - again, J. Rec. Math., 5 (No. 4, 1972), 253-254.
  • Thomas E. Moore, A Note on the Distribution of Primes in Arithmetic Progressions, J. Rec. Math., 5 (1972), 253-254.
  • R. C. Schroeppel, personal communication, 1991.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • D. Zwillinger, Consecutive-Digit Primes - In Different Bases, J. Rec. Math., 10 (1972), 32-33.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{u = Range@n, t = Table[1, {n}]}, Select[ Drop[ Union@ Flatten@ Table[ FromDigits[ Mod[u + i*t, 10]], {i, 10}], 2], PrimeQ@# &]]; Array[f, 35] // Flatten (* Robert G. Wilson v, Jul 05 2006 *)
  • Python
    from sympy import isprime
    from itertools import count, islice
    def bgen(): yield from (int("".join(str((s0+i)%10) for i in range(d))) for d in count(1) for s0 in range(1, 10))
    def agen(): yield from filter(isprime, bgen())
    print(list(islice(agen(), 18))) # Michael S. Branicky, May 26 2022

Extensions

a(17) from Robert G. Wilson v, Jul 05 2006
Entry revised by N. J. A. Sloane, Feb 07 2007

A048405 Primes with consecutive digits that differ exactly by 8.

Original entry on oeis.org

2, 3, 5, 7, 19, 191, 919, 919191919, 91919191919, 91919191919191919, 91919191919191919191919, 191919191919191919191919191919191
Offset: 1

Views

Author

Patrick De Geest, Apr 15 1999

Keywords

Comments

The next term (a(13)) has 133 digits. - Harvey P. Dale, Jan 04 2023

Examples

			2 is a term since all its consecutive digits differ by 5 (there aren't any).
19 is a term because 1 and 9 differ by 8.
23 is not a term because its consecutive digits differ only by 1.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=500,nine,one},one=Select[Table[FromDigits[PadRight[{},n,{1,9}]],{n,nn}],PrimeQ];nine=Select[Table[FromDigits[PadRight[{},n,{9,1}]],{n,nn}],PrimeQ];Sort[Join[{2,3,5,7},nine,one]]] (* Harvey P. Dale, Jan 04 2023 *)

Extensions

Offset corrected by Sean A. Irvine, Jun 16 2021

A048399 Primes with consecutive digits that differ exactly by 2.

Original entry on oeis.org

2, 3, 5, 7, 13, 31, 53, 79, 97, 131, 313, 353, 757, 797, 31357, 35353, 35753, 35797, 75353, 75797, 79757, 97579, 131357, 135353, 135757, 353531, 531353, 535757, 575753, 579757, 757579, 797579, 975313, 975797, 979757, 1313579, 3131353
Offset: 1

Views

Author

Patrick De Geest, Apr 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    Join[{2,3,5,7},Select[Prime[Range[230000]],Union[Abs[ Differences[ IntegerDigits[ #]]]]=={2}&]] (* Harvey P. Dale, Nov 03 2013 *)

A048400 Primes with consecutive digits that differ exactly by 3.

Original entry on oeis.org

2, 3, 5, 7, 41, 47, 14741, 14747, 74747, 1414741, 1474141, 7414741, 4141414747, 4147414147, 14141414141, 14141414741, 14141474741, 14141474747, 14147414741, 14147474141, 14147474147, 14741414747, 74141414147, 74141414741, 74147414741, 74741474741, 74747414141
Offset: 1

Views

Author

Patrick De Geest, Apr 15 1999

Keywords

Comments

All terms with more than a single digit must comprise only the digits 1, 4, and 7, because no number comprising the digits 2, 5, and 8 or the digits 3, 6, and 9 can be prime. - Harvey P. Dale, Mar 01 2023

Crossrefs

Programs

  • Mathematica
    Join[{2,3,5,7},Table[Select[FromDigits/@Tuples[{1,4,7},n],PrimeQ[#]&& Union[ Abs[ Differences[ IntegerDigits[ #]]]]=={3}&],{n,11}]//Flatten] (* Harvey P. Dale, Mar 01 2023 *)

Extensions

More terms from Naohiro Nomoto, Jul 28 2001
More terms from Sean A. Irvine, Jun 15 2021

A048401 Primes with consecutive digits that differ exactly by 4.

Original entry on oeis.org

2, 3, 5, 7, 37, 59, 73, 151, 373, 15959, 95959, 515951, 595159, 595951, 9515959, 51515159, 159595151, 159595951, 5151515951, 5159515159, 5159515951, 5951515151, 5951515951, 5959515151, 5959595951, 15151595951, 15951515159
Offset: 1

Views

Author

Patrick De Geest, Apr 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    pd[{a_,b_,c___}]:=Flatten[Table[Select[FromDigits/@Select[Tuples[ {a,b,c},n],Union[Abs[Differences[#]]]=={4}&],PrimeQ],{n,11}]]; Union[Join[{2,3,5,7},pd[{1,5,9}],pd[{3,7}]]] (* Harvey P. Dale, Aug 23 2011 *)

Extensions

More terms from Naohiro Nomoto, Jul 28 2001

A134811 Giza primes.

Original entry on oeis.org

2, 3, 5, 7, 787, 34543, 345676543, 34567876543
Offset: 1

Views

Author

Omar E. Pol, Nov 30 2007

Keywords

Comments

Giza numbers (A134810) that are prime numbers. For n > 4 the structure of digits represents a pyramid at Giza. Also the top of a mountain. This sequence has only these 8 terms in base 10. For more information, see A134810.

Examples

			Illustration using the final term of this sequence:
  . . . . . . . . . . .
  . . . . . 8 . . . . .
  . . . . 7 . 7 . . . .
  . . . 6 . . . 6 . . .
  . . 5 . . . . . 5 . .
  . 4 . . . . . . . 4 .
  3 . . . . . . . . . 3
  . . . . . . . . . . .
  . . . . . . . . . . .
  . . . . . . . . . . .
		

References

  • Chris K. Caldwell and G. L. Honaker, Jr; Prime Curios!, The Dictionary of Prime Number Trivia, CreateSpace (2009), p. 209.

Crossrefs

Programs

  • Mathematica
    ups = Flatten[Table[Range[i, j - 1], {i, 1, 9}, {j, i + 1, 10}], 1];afull = Sort[  Map[ToExpression@StringJoin@Map[ToString, #[[;; -2]] ~Join~ Reverse[#]] &, ups]];Select[afull,PrimeQ] (* James C. McMahon, Apr 11 2025 *)

Formula

A000040 INTERSECT A134810. - Omar E. Pol, Mar 25 2011

Extensions

Reference and link added by Omar E. Pol, Mar 25 2011

A048402 Primes with consecutive digits that differ exactly by 5.

Original entry on oeis.org

2, 3, 5, 7, 61, 83, 383, 727, 72727, 94949, 1616161, 383838383, 727272727, 383838383838383, 38383838383838383, 72727272727272727, 94949494949494949, 383838383838383838383
Offset: 1

Views

Author

Patrick De Geest, Apr 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{nn=50,w1,w2},w1=Flatten[Table[Select[FromDigits/@Table[ PadRight[ {},n,{a,a+5}],{n,2,nn}],PrimeQ],{a,4}]];w2=Flatten[Table[Select[ FromDigits/@ Table[PadRight[{},n,{a+5,a}],{n,2,nn}],PrimeQ],{a,4}]];Join[ {2,3,5,7},w1,w2]//Union] (* Harvey P. Dale, Jan 09 2021 *)
Showing 1-10 of 21 results. Next