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

A079950 Triangle of n-th prime modulo twice primes less n-th prime.

Original entry on oeis.org

2, 3, 3, 1, 5, 5, 3, 1, 7, 7, 3, 5, 1, 11, 11, 1, 1, 3, 13, 13, 13, 1, 5, 7, 3, 17, 17, 17, 3, 1, 9, 5, 19, 19, 19, 19, 3, 5, 3, 9, 1, 23, 23, 23, 23, 1, 5, 9, 1, 7, 3, 29, 29, 29, 29, 3, 1, 1, 3, 9, 5, 31, 31, 31, 31, 31, 1, 1, 7, 9, 15, 11, 3, 37, 37, 37, 37, 37, 1, 5, 1, 13, 19, 15, 7, 3, 41
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 19 2003

Keywords

Comments

The right border of the triangle are the primes: T(n,n)=A000040(n); T(n,1)=A039702(n), T(n,2)=A039704(n) for n>1, T(n,3)=A007652(n) for n>2, T(n,4)=A039712(n) for n>3;

Examples

			Triangle begins:
  2;
  3, 3;
  1, 5, 5;
  3, 1, 7,  7;
  3, 5, 1, 11, 11;
  1, 1, 3, 13, 13, 13;
  1, 5, 7,  3, 17, 17, 17;
  ...
		

Crossrefs

Programs

  • Maple
    A079950 := proc(n,k)
        modp(ithprime(n),2*ithprime(k)) ;
    end proc:
    seq(seq(A079950(n,k),k=1..n),n=1..12) ; # R. J. Mathar, Sep 28 2017
  • PARI
    T(n,k) = prime(n) % (2*prime(k));
    tabl(nn) = for (n=1, nn, for (k=1, n, print1(T(n,k), ", ")); print); \\ Michel Marcus, Sep 21 2017

Formula

T(n, k) = prime(n) mod 2*prime(k), 1<=k<=n.

A089787 a(4n-3), a(4n-2), a(4n-1), and a(4n) are the units digit of the n-th prime followed by 1, 3, 7, and 9 respectively.

Original entry on oeis.org

21, 23, 27, 29, 31, 33, 37, 39, 51, 53, 57, 59, 71, 73, 77, 79, 11, 13, 17, 19, 31, 33, 37, 39, 71, 73, 77, 79, 91, 93, 97, 99, 31, 33, 37, 39, 91, 93, 97, 99, 11, 13, 17, 19, 71, 73, 77, 79, 11, 13, 17, 19, 31, 33, 37, 39, 71, 73, 77, 79, 31, 33, 37, 39, 91, 93, 97, 99, 11
Offset: 1

Views

Author

Roger L. Bagula, Jan 09 2004

Keywords

Crossrefs

Cf. A089784 (essentially the same).

Programs

  • Mathematica
    Flatten[Table[Mod[Prime[n], 10]*10+{1, 3, 7, 9}, {n, 1, 50}]]
    a[n_] := Mod[Prime[Floor[(n + 3)/4]], 10]*10 + {1, 3, 7,
    9}[[Mod[n - 1, 4] + 1]] (* Charles R Greathouse IV, Jan 02 2013 *)
    Table[10*Mod[Prime[n],10]+{1,3,7,9},{n,30}]//Flatten (* Harvey P. Dale, Aug 24 2019 *)
  • PARI
    a(n)=prime((n+3)\4)%10*10+[9,1,3,7][n%4+1] \\ Charles R Greathouse IV, Jan 02 2013

Formula

a(n) = 5+(-1)^n+3*cos(n*Pi/2)-3*sin(n*Pi/2)+10*(prime(floor((n+3)/4)) mod 10). - Wesley Ivan Hurt, May 06 2021

A101306 a(n) = Sum_{i=1..n} {last digit of prime(i)}.

Original entry on oeis.org

2, 5, 10, 17, 18, 21, 28, 37, 40, 49, 50, 57, 58, 61, 68, 71, 80, 81, 88, 89, 92, 101, 104, 113, 120, 121, 124, 131, 140, 143, 150, 151, 158, 167, 176, 177, 184, 187, 194, 197, 206, 207, 208, 211, 218, 227, 228, 231, 238, 247, 250, 259, 260, 261, 268, 271, 280
Offset: 1

Views

Author

Jorge Coveiro, Dec 22 2004

Keywords

Comments

Asymptotically, a(n) ~ 5n by Dirichlet's theorem. - Charles R Greathouse IV, Sep 28 2008

Examples

			a(1) = 2;
a(2) = 2 + 3 = 5;
a(3) = 2 + 3 + 5 = 10;
a(4) = 2 + 3 + 5 + 7 = 17;
a(5) = 2 + 3 + 5 + 7 + 1(1) = 2 + 3 + 5 + 7 + 1 = 18.
		

Crossrefs

Partial sums of A007652.

Programs

Extensions

Corrected and extended by Robert G. Wilson v, Dec 22 2004

A129750 Absolute difference of final digits of consecutive primes.

Original entry on oeis.org

1, 2, 2, 6, 2, 4, 2, 6, 6, 8, 6, 6, 2, 4, 4, 6, 8, 6, 6, 2, 6, 6, 6, 2, 6, 2, 4, 2, 6, 4, 6, 6, 2, 0, 8, 6, 4, 4, 4, 6, 8, 0, 2, 4, 2, 8, 2, 4, 2, 6, 6, 8, 0, 6, 4, 6, 8, 6, 6, 2, 0, 4, 6, 2, 4, 6, 6, 0, 2, 6, 6, 2, 4, 6, 6, 6, 2, 6, 8, 0, 8, 0, 2, 6, 6, 6, 2, 6, 2, 4, 2, 2, 6, 8, 6, 6, 8, 2, 2, 6, 0, 4, 6, 8, 6
Offset: 1

Views

Author

Giovanni Teofilatto, Jun 02 2007

Keywords

Crossrefs

Cf. A007652.

Programs

  • Mathematica
    f[n_] := Abs[Mod[Prime[n + 1], 10] - Mod[Prime[n], 10]]; Array[f, 105] (* Ray Chandler, Jun 12 2007 *)

Extensions

Corrected and extended by Ray Chandler, Jun 12 2007

A063272 Number of times most common final digit of primes appears in first n primes.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 21, 21
Offset: 1

Views

Author

Henry Bottomley, Jul 13 2001

Keywords

Examples

			a(6)=2 since first six primes are 2,3,5,7,11,13, so most common final digit is 3 which has appeared twice.
		

Crossrefs

Cf. A000040, A007652, A063272. Slightly above floor(n/4), i.e., A002265.

Programs

  • Maple
    V:= Vector(9):
    p:= 1:
    for n from 1 to 100 do
      p:= nextprime(p);
      r:= p mod 10;
      V[r]:= V[r]+1;
      A[n]:= max(V)
    od:
    seq(A[i],i=1..100); # Robert Israel, Jul 22 2018

Formula

a(n) ~ n/phi(10) = n/4 by the Prime Number Theorem in Arithmetic Progressions. - Charles R Greathouse IV, Dec 29 2012

A089784 A nonsense sequence.

Original entry on oeis.org

81, 83, 87, 89, 71, 73, 77, 79, 51, 53, 57, 59, 31, 33, 37, 39, 11, 13, 17, 19, 31, 33, 37, 39, 71, 73, 77, 79, 91, 93, 97, 99, 31, 33, 37, 39, 91, 93, 97, 99, 11, 13, 17, 19, 71, 73, 77, 79, 11, 13, 17, 19, 31, 33, 37, 39, 71, 73, 77, 79, 31, 33, 37, 39, 91, 93, 97, 99, 11
Offset: 1

Views

Author

Roger L. Bagula, Jan 09 2004

Keywords

Crossrefs

Cf. A089787 (essentially the same).

Programs

  • Mathematica
    a={1, 3, 7, 9};
    Flatten[Table[Mod[Abs[10-Prime[n]], 10]*10+a, {n, 50}]]

A093339 Middle digits of primes with an odd number of digits.

Original entry on oeis.org

2, 3, 5, 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, 0, 0, 1, 1, 1, 3, 4, 4, 4, 5, 5, 6, 7, 7, 8, 9, 0
Offset: 2

Views

Author

Cino Hilliard, Apr 25 2004

Keywords

Crossrefs

Programs

  • Mathematica
    mdp[n_]:=Module[{idn=IntegerDigits[n],len=IntegerLength[n]},If[EvenQ[len], -1,idn[[(len-1)/2+1]]]]; Select[mdp/@Prime[Range[500]],NonNegative] (* Harvey P. Dale, Feb 26 2012 *)
  • PARI
    midd(n) = { forprime(x=2,n, s = Str(x); ln = length(s); if(ln<2,p=1,p = (ln-1)/2+1); if(ln%2, md = eval(mid(s,p,1)); print1(md",") ) ) } \ 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) }

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

A253721 Triprimes modulo 10.

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, May 02 2015

Keywords

Comments

Last digit of triprimes (A014612).

Crossrefs

Cf. A010879 (final digit of n), A014612 (triprimes).
Cf. A007652 (primes mod 10), A106146 (semiprimes mod 10).
Cf. A255646 (subsequence).

Programs

  • Haskell
    a253721 = flip mod 10 . a014612  -- Reinhard Zumkeller, May 05 2015
    
  • Maple
    with(numtheory): A253721:=n->`if`(bigomega(n) = 3, n mod 10, NULL): seq(A253721(n), n=1..500);
  • Mathematica
    Mod[#, 10] & /@ Select[Range[500], PrimeOmega[#] == 3 &]
  • PARI
    do(x)=my(v=List(), t); forprime(p=2, x\4, forprime(q=2, min(x\(2*p), p), t=p*q; forprime(r=2, min(x\t, q), listput(v, t*r)))); Set(v)%10 \\ Charles R Greathouse IV, Aug 30 2017
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, integer_nthroot
    def A253721(n):
        def f(x): return int(n+x-sum(primepi(x//(k*m))-b for a,k in enumerate(primerange(integer_nthroot(x,3)[0]+1)) for b,m in enumerate(primerange(k,isqrt(x//k)+1),a)))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m%10 # Chai Wah Wu, Aug 17 2024

Formula

a(n) = A010879(A014612(n)). - Michel Marcus, May 03 2015

A386964 a(1) = prime(1) = 2, a(n) = 10*a(n-1) + (prime(n) mod 10).

Original entry on oeis.org

2, 23, 235, 2357, 23571, 235713, 2357137, 23571379, 235713793, 2357137939, 23571379391, 235713793917, 2357137939171, 23571379391713, 235713793917137, 2357137939171373, 23571379391713739, 235713793917137391, 2357137939171373917, 23571379391713739171, 235713793917137391713
Offset: 1

Views

Author

Michael S. Branicky, Aug 11 2025

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<1, 0, a(n-1)*10+irem(ithprime(n), 10)) end:
    seq(a(n), n=1..21);  # Alois P. Heinz, Aug 12 2025
  • Mathematica
    a[1]=2;a[n_]:=10a[n-1]+Mod[Prime[n],10];Array[a,21] (* James C. McMahon, Aug 12 2025 *)
  • Python
    from sympy import nextprime
    from itertools import islice
    def A386964(): # generator of terms
        an = pn = 2
        while True:
            yield an
            an = 10*an + (pn:=nextprime(pn))%10
    print(list(islice(A386964(), 21)))

Formula

a(n) = concatenation of A007652(1)..A007652(n).
Previous Showing 21-30 of 59 results. Next