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.

Previous Showing 31-40 of 59 results. Next

A083786 Composite numbers mod 10.

Original entry on oeis.org

4, 6, 8, 9, 0, 2, 4, 5, 6, 8, 0, 1, 2, 4, 5, 6, 7, 8, 0, 2, 3, 4, 5, 6, 8, 9, 0, 2, 4, 5, 6, 8, 9, 0, 1, 2, 4, 5, 6, 7, 8, 0, 2, 3, 4, 5, 6, 8, 9, 0, 2, 4, 5, 6, 7, 8, 0, 1, 2, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 8, 9, 0, 2, 4, 5, 6, 8, 0, 1, 2, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 8, 9, 0, 2, 3, 4, 5, 6, 8, 0
Offset: 1

Views

Author

Roger L. Bagula, Aug 21 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Mod[Rest@ Select[Range@140, !PrimeQ@# &], 10] (* Robert G. Wilson v, Mar 17 2006 *)
  • PARI
    lista(nn) = forcomposite(n=2, nn, print1(n % 10, ", ")); \\ Michel Marcus, Oct 30 2017

Formula

a(n) = A002808(n) mod 10. - Ray Chandler, Sep 04 2003

Extensions

More terms from Ray Chandler, Sep 04 2003
Entries checked by Robert G. Wilson v, Mar 17 2006

A093336 Second digit of prime(n).

Original entry on oeis.org

1, 3, 7, 9, 3, 9, 1, 7, 1, 3, 7, 3, 9, 1, 7, 1, 3, 9, 3, 9, 7, 0, 0, 0, 0, 1, 2, 3, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 9, 9, 9, 9, 1, 2, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 0, 1, 1, 1, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 0, 0, 1, 2, 3, 3, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 9, 0, 0, 2, 2, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9
Offset: 5

Views

Author

Cino Hilliard, Apr 25 2004

Keywords

Crossrefs

Programs

  • Mathematica
    IntegerDigits[#][[2]]&/@Prime[Range[5,110]] (* Harvey P. Dale, Dec 22 2013 *)
  • PARI
    second(n) = { forprime(x=11,n, sd = mid(Str(x),2,1); print1(sd",") ) } \ Get a substring of length n from string str starting at position s in str. mid(str,s,n) = { v =""; tmp = Vec(str); ln=length(tmp); for(x=s,s+n-1, v=concat(v,tmp[x]); ); return(v) }

Extensions

Offset corrected by Matthew House, Aug 09 2015

A106727 Triangle T(n,k) = (f(n+1)*f(k+1) mod 10), where f(j) = 10 - (prime(j+3) mod 10), read by rows.

Original entry on oeis.org

9, 7, 1, 1, 3, 9, 9, 7, 1, 9, 3, 9, 7, 3, 1, 1, 3, 9, 1, 7, 9, 3, 9, 7, 3, 1, 7, 1, 7, 1, 3, 7, 9, 3, 9, 1, 9, 7, 1, 9, 3, 1, 3, 7, 9, 7, 1, 3, 7, 9, 3, 9, 1, 7, 1, 1, 3, 9, 1, 7, 9, 7, 3, 1, 3, 9, 9, 7, 1, 9, 3, 1, 3, 7, 9, 7, 1, 9, 1, 3, 9, 1, 7, 9, 7, 3, 1, 3, 9, 1, 9
Offset: 0

Views

Author

Roger L. Bagula, May 14 2005

Keywords

Examples

			Triangle begins:
  9;
  7, 1;
  1, 3, 9;
  9, 7, 1, 9;
  3, 9, 7, 3, 1;
  1, 3, 9, 1, 7, 9;
  3, 9, 7, 3, 1, 7, 1;
		

Crossrefs

Programs

  • Mathematica
    f[n_]:= 10 - Mod[Prime[n+3], 10];
    Table[Mod[f[n+1]*f[k+1], 10], {n,0,15}, {k,0,n}]//Flatten
  • Sage
    def f(n): return 10 - (nth_prime(n+3)%10)
    def A106727(n,k): return (f(n+1)*f(k+1))%10
    flatten([[A106727(n,k) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Sep 10 2021

Formula

T(n, k) = (f(n+1)*f(k+1) mod 10) where f(j) = 10 - (prime(j+3) mod 10).

A137589 a(n) is the integer that results after deletion of all digits of n-th prime, except the initial digit and the final digit.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 11, 13, 17, 19, 13, 17, 11, 17, 19, 19, 11, 17, 13, 17, 13, 19, 11, 11, 13, 17, 19, 21, 23, 27, 29, 23, 29, 21, 21, 27, 23, 29, 21, 27, 21, 23, 23, 37, 31, 33, 37, 31, 37, 37, 39, 33
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 26 2008

Keywords

Comments

The plot of this sequence shows number of primes on the x-axis and the split of primes into 9 groups according to their first digit on the y-axis. The plot of a(n+1)/a(n) oscillates around 1 with decreasing amplitude. Log-periodic growth is seen on the plot of partial sums b(n)= Sum_(i=1..n) a(i).

Examples

			a(100) = 51 as prime(100) = 541. Concatenating the first and last digit gives 51. - _David A. Corneth_, Mar 23 2018
		

Crossrefs

Another version of A138840 which is older.

Programs

  • Mathematica
    fdld[n_]:=Module[{idn=IntegerDigits[n]},FromDigits[{First[idn], Last[ idn]}]]; Join[Prime[Range[25]],fdld/@Prime[Range[26,100]]] (* Harvey P. Dale, Oct 10 2012 *)
  • PARI
    a(n) = my(p = prime(n), d); if(n<=4, return(p)); d = digits(p); 10*d[1] + d[#d] \\ David A. Corneth, Mar 23 2018

Formula

a(n) = A138840(n) if n >= 5. - Omar E. Pol, Mar 23 2018

Extensions

New name from Omar E. Pol, Mar 24 2018

A137727 Final digit of prime(n)*prime(n+1).

Original entry on oeis.org

6, 5, 5, 7, 3, 1, 3, 7, 7, 9, 7, 7, 3, 1, 1, 7, 9, 7, 7, 3, 7, 7, 7, 3, 7, 3, 1, 3, 7, 1, 7, 7, 3, 1, 9, 7, 1, 1, 1, 7, 9, 1, 3, 1, 3, 9, 3, 1, 3, 7, 7, 9, 1, 7, 1, 7, 9, 7, 7, 3, 9, 1, 7, 3, 1, 7, 7, 9, 3, 7, 7, 3, 1, 7, 7, 7, 3, 7, 9, 1, 9, 1, 3, 7, 7, 7, 3, 7, 3, 1, 3, 3, 7, 9, 7, 7, 9, 3, 3, 7, 9, 1, 7, 9, 7
Offset: 1

Views

Author

Alexander Adamchuk, Feb 08 2008

Keywords

Comments

a(n) is 1, 3, 7, or 9 for n > 3. I conjecture that 1 and 9 appear 17/66 of the time and 3 and 7 appear 8/33 of the time. - Charles R Greathouse IV, Jan 03 2013

Crossrefs

Cf. A006094 (Products of 2 successive primes), A007652 (Final digit of prime(n)), A010879 (final digit of n), A110923 (final two digits of prime(n) (with leading zero omitted)), A137728 (second digit from the end of product of first n primes).

Programs

  • Mathematica
    Table[ Mod[ Prime[n]*Prime[n+1], 10 ], {n,1,1000} ]
    Mod[Times@@@Partition[Prime[Range[110]],2,1],10] (* Harvey P. Dale, Oct 05 2014 *)
  • PARI
    a(n)=prime(n)*prime(n+1)%10 \\ Charles R Greathouse IV, Dec 29 2012
    
  • Python
    from sympy import prime
    def a(n): return (prime(n)*prime(n+1))%10
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Jun 05 2021
    
  • Python
    # much faster alternate for initial segment of sequence
    from sympy import nextprime
    def aupton(terms):
        p1, p2, alst = 2, 3, []
        while len(alst) < terms:
            p1, p2, alst = p2, nextprime(p2), alst + [(p1*p2)%10]
        return alst
    print(aupton(105)) # Michael S. Branicky, Jun 05 2021

Formula

a(n) = A010879(A006094(n)). - Felix Fröhlich, Jun 05 2021

A137728 Second digit from the end of product of first n primes.

Original entry on oeis.org

0, 0, 3, 1, 1, 3, 1, 9, 7, 3, 3, 1, 1, 3, 1, 3, 7, 7, 9, 9, 7, 3, 9, 1, 7, 7, 1, 7, 3, 9, 3, 3, 1, 9, 1, 1, 7, 1, 7, 1, 9, 9, 9, 7, 9, 1, 1, 3, 1, 9, 7, 3, 3, 3, 1, 3, 7, 7, 9, 9, 7, 1, 7, 7, 1, 7, 7, 9, 3, 7, 1, 9, 3, 9, 1, 3, 7, 9, 9, 1, 9, 9, 9, 7, 3, 9, 1, 7, 7, 1, 7, 3, 1, 1, 9, 7, 3, 3, 9, 9, 3, 1, 3, 7, 7
Offset: 1

Views

Author

Alexander Adamchuk, Feb 08 2008

Keywords

Comments

a(1) = a(2) = 0 because prime(1) = 2 and prime(1)*prime(2) = 6 are one-digit numbers.

Crossrefs

Cf. A007652 = Final digit of prime(n).
Cf. A110923 = Final two digits of prime(n).
Cf. A137727 = Final digit of prime(n)*prime(n+1).
Cf. A002110 = Primorial numbers, p#.

Programs

  • Maple
    a[1]:= 0: a[2]:= 0: a[3]:= 3: p:= 5:
    for n from 4 to 1000 do
      p:= nextprime(p);
      a[n]:= (a[n-1] * p) mod 10:
    od: # Robert Israel, Nov 22 2018
  • Mathematica
    a(1) = a(2) = 0, for n>2 Table[ Mod[ Product[ Prime[n], {n,1,k} ], 100 ]/10, {k,3,1000} ]

Formula

a(n) = A002110(n)/10 mod 10 for n > 2; a(1) = a(2) = 0.

A244191 a(n) = most common final digit for a prime < 10^n, or 0 if there is a tie.

Original entry on oeis.org

0, 3, 7, 3, 7, 3, 3, 7, 3, 3, 7, 7, 3, 3
Offset: 1

Views

Author

Derek Orr, Jun 22 2014

Keywords

Examples

			For all 25 primes < 100 (10^2), we see that the last digit that appears the most is 3. Thus a(2) = 3.
		

Crossrefs

Programs

  • Python
    import sympy
    from sympy import isprime
    def prend(d,n):
      lst = []
      for k in range(10**n):
        if isprime(k):
          lst.append((k%10**d))
      new = 0
      newlst = []
      for i in range(10**(d-1),10**d):
        new = lst.count(i)
        newlst.append(new)
      newlst1 = newlst.copy()
      a = max(newlst1)
      newlst1[newlst1.index(a)] = 0
      b = max(newlst1)
      if a == b:
        return 0
      else:
        return newlst.index(max(a,b)) + 10**(d-1)
    n = 2
    while n < 10:
      print(prend(1,n),end=', ')
      n += 1

Extensions

a(9)-a(14) from Hiroaki Yamanouchi, Sep 27 2014

A276481 Numbers k such that b(k) is prime, where b(1) = prime(1) = 2, b(n) = 10*b(n-1) + (prime(n) mod 10).

Original entry on oeis.org

1, 2, 4, 13, 16, 17, 28, 34, 90, 100, 132, 331, 534, 7923, 10157, 40197
Offset: 1

Views

Author

Thomas Ordowski, Sep 05 2016

Keywords

Comments

Primes in the sequence b(n) are 2, 23, 2357, 2357137939171, ...
a(17) > 50000. - Michael S. Branicky, Aug 12 2025

Crossrefs

Programs

  • Maple
    Res:= NULL: p:= 0: b:= 0:
    for n from 1 to 600 do
      p:= nextprime(p);
      b:= 10*b + (p mod 10);
      if isprime(b) then Res:= Res, n fi
    od:
    Res; # Robert Israel, Sep 05 2016
  • Mathematica
    b[1] = Prime@ 1; b[n_] := b[n] = 10 b[n - 1] + Mod[Prime@ n, 10]; Select[Range[10^3], PrimeQ@ b[#] &] (* Michael De Vlieger, Sep 06 2016 *)
  • PARI
    b(n) = if (n==1, 2, 10*b(n-1) + (prime(n) % 10));
    isok(n) = isprime(b(n)); \\ Michel Marcus, Sep 05 2016
    
  • PARI
    list(lim)=my(v=List(),s,n); forprime(p=2,, if(n++>lim, return(Vec(v))); if(ispseudoprime(s=10*s+p%10), listput(v, n))) \\ Charles R Greathouse IV, Sep 05 2016

Formula

{k | A386964(k) is prime}. - Michael S. Branicky, Aug 12 2025

Extensions

a(7)-a(13) from Michel Marcus, Sep 05 2016
a(14) from Robert Israel, Sep 05 2016
a(15)-a(16) from Michael S. Branicky, Aug 11 2025

A354589 Primes p starting a sequence of 4 consecutive primes whose final digits are 1,3,7,9 (in any order).

Original entry on oeis.org

11, 23, 47, 53, 67, 83, 89, 101, 109, 149, 167, 191, 193, 197, 199, 211, 251, 257, 263, 383, 443, 449, 461, 487, 557, 563, 587, 593, 599, 613, 647, 659, 739, 757, 761, 821, 859, 983, 991, 1061, 1063, 1069, 1117, 1217, 1223, 1283, 1301, 1303, 1367, 1433, 1439, 1447, 1481, 1553, 1567, 1571, 1579
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Aug 18 2022

Keywords

Examples

			a(3) = 47 is in the sequence because the 4 consecutive primes starting with 47 are 47, 53, 59, 61, and their final digits 7,3,9,1 are a permutation of 1,3,7,9.
		

Crossrefs

Programs

  • Maple
    P:= select(isprime, [seq(i,i=3..2000,2)]):
    P1:= P mod 10:
    P[select(i -> convert(P1[i..i+3],set) = {1,3,7,9}, [$1..nops(P)-3])];
  • Mathematica
    Select[Partition[Prime[Range[300]], 4, 1], Sort[Mod[#, 10]] == {1, 3, 7, 9} &][[;; , 1]] (* Amiram Eldar, Aug 19 2022 *)
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        p = [2, 3, 5, 7]
        while True:
            if set(map(lambda x: x%10, p)) == {1, 3, 7, 9}: yield p[0]
            p = p[1:] + [nextprime(p[-1])]
    print(list(islice(agen(), 60))) # Michael S. Branicky, Aug 18 2022

A371390 Numbers k such that prime(k), prime(k+1), prime(k+2), prime(k+3) and prime(k+4) all have the same last digit.

Original entry on oeis.org

11582, 17385, 19317, 20579, 22931, 42098, 51895, 52252, 55259, 60393, 62192, 62193, 62680, 64050, 65324, 71483, 76391, 76773, 76805, 77052, 81139, 86711, 95661, 100208, 102032, 113646, 113892, 113954, 115251, 124227, 125218, 125586, 144165, 144299, 147619, 147620
Offset: 1

Views

Author

Michel Lagneau, Mar 20 2024

Keywords

Examples

			11582 is a term because prime(11582) = 123229, prime(11583) = 123239, prime(11584) = 123259, prime(11585) = 123269 with the same last digit 9.
		

Crossrefs

Programs

  • Maple
    nn:=15*10^4:d:=array(1..5):
    for n from 1 to nn do:
     for k from 1 to 5 do:
       d[k]:=irem(ithprime(n+k-1),10):
     od:
      if d[1]=d[2] and d[1]=d[3] and
    d[1]=d[4] and d[1]=d[5]
        then
         printf(`%d, `,n):
        else
      fi:
    od:
  • PARI
    \\ See PARI link
    
  • Python
    from itertools import count, islice
    from sympy import nextprime
    def A371390_gen(): # generator of terms
        xlist, p = [2, 3, 5, 7, 1], 11
        for k in count(1):
            if len(set(xlist)) == 1:
                yield k
            p = nextprime(p)
            xlist = xlist[1:]+[p%10]
    A371390_list = list(islice(A371390_gen(),10)) # Chai Wah Wu, Apr 13 2024
Previous Showing 31-40 of 59 results. Next