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 41-50 of 59 results. Next

A048199 Distance of primes to next odd multiple of 5 (where n mod 10 = 5).

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			Take first prime 2, subtract from 5: 5-2=3, distance to 5; take 5-5 = 0; or 4th term, 15-7=8. Sequence may be converted to distance to nearest value of n (absolute value, where n mod 10 = 5) by changing all 8's to 2's and all 6's to 4's.
		

Crossrefs

Programs

  • PARI
    a(n) = {p = prime(n); k = 0; while ((p+k) % 10 != 5, k++); k;} \\ Michel Marcus, Aug 25 2013

A122754 a(n) = 10*n - A101306(n).

Original entry on oeis.org

8, 15, 20, 23, 32, 39, 42, 43, 50, 51, 60, 63, 72, 79, 82, 89, 90, 99, 102, 111, 118, 119, 126, 127, 130, 139, 146, 149, 150, 157, 160, 169, 172, 173, 174, 183, 186, 193, 196, 203, 204, 213, 222, 229, 232, 233, 242, 249, 252, 253
Offset: 1

Views

Author

Roger L. Bagula, Sep 21 2006

Keywords

Crossrefs

Cf. A101306.
Partial sums of A072003.

Programs

  • Mathematica
    Table[Sum[10 - Mod[Prime[n], 10], {n, 1, m}], {m, 1, 50}]

Formula

a(n) = Sum_{i=1..n} (10 - A007652(n)).

Extensions

Definition simplified by the Assoc. Eds. of the OEIS, Mar 27 2010

A161625 Sum of all numbers from 1 up to the final digit of prime(n).

Original entry on oeis.org

3, 6, 15, 28, 1, 6, 28, 45, 6, 45, 1, 28, 1, 6, 28, 6, 45, 1, 28, 1, 6, 45, 6, 45, 28, 1, 6, 28, 45, 6, 28, 1, 28, 45, 45, 1, 28, 6, 28, 6, 45, 1, 1, 6, 28, 45, 1, 6, 28, 45, 6, 45, 1, 1, 28, 6, 45, 1, 28, 1, 6, 6, 28, 1, 6, 28, 1, 28, 28, 45, 6, 45, 28, 6, 45, 6, 45, 28, 1, 45
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 15 2009

Keywords

Examples

			a(1)=3=1+2. a(2)=6=1+2+3. a(3)=15=1+2+3+4+5. a(4)=28=1+2+3+4+5+6+7. a(5)=1=1. a(6)=3=1+2.
		

Crossrefs

Programs

Formula

a(n)= A000217(A007652(n)). - R. J. Mathar, Jun 16 2009

Extensions

Definition reworded and a 16 split in 1,6 by R. J. Mathar, Jun 16 2009

A175348 Last digit of p^p, where p is the n-th prime.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Euler and Sadek ask whether the sequence, interpreted as the decimal expansion N = 0.47531..., is rational or irrational.
Dickson's conjecture implies that each finite sequence with values in {1,3,7,9} occurs as a substring. In particular, this implies that the above N is irrational. - Robert Israel, Jan 26 2017

Examples

			prime(4) = 7 and 7^7 = 823543, so a(4) = 3.
		

References

  • R. Euler and J. Sadek, A number that gives the unit digit of n^n. Journal of Recreational Mathematics, 29:3 (1998), pp. 203-204.

Crossrefs

Programs

  • Maple
    R:= [seq(i &^ i mod 10, i=1..20)]:
    seq(R[ithprime(i) mod 20],i=1..100); # Robert Israel, Jan 26 2017
  • Mathematica
    Table[PowerMod[n,n,10],{n,Prime[Range[110]]}] (* Harvey P. Dale, Mar 24 2024 *)
  • PARI
    a(n)=[1,4,7,0,5,0,3,0,9,0,1,0,3,0,0,0,7,0,9][prime(n)%20]

Formula

a(n) = A056849(A000040(n)). - Robert Israel, Jan 26 2017

A253936 a(n) = prime(n + (prime(n) mod 10)).

Original entry on oeis.org

5, 11, 19, 31, 13, 23, 43, 59, 37, 67, 37, 67, 43, 59, 79, 67, 101, 67, 101, 73, 89, 127, 101, 137, 131, 103, 113, 149, 163, 137, 163, 137, 173, 191, 193, 157, 193, 179, 199, 191, 229, 191, 193, 211, 239, 257, 223, 233, 263, 277, 251, 283, 251, 257, 293, 277, 317, 277, 317, 283, 311, 313, 349, 313, 337, 367, 337, 379, 383
Offset: 1

Views

Author

Zak Seidov, Jan 23 2015

Keywords

Examples

			n=1: p=prime(1)=2; p mod 10 = 2, prime(1+2) = 5 = a(1);
n=6: p=prime(6)=13; p mod 10 = 3, prime(6+3) = 23 = a(6).
		

Crossrefs

Programs

  • Mathematica
    Table[Prime[n+Mod[Prime[n],10]],{n,100}]
  • PARI
    a(n)=prime(n+prime(n)%10)

Formula

a(n) = A000040(n + A010879(A000040(n))),
a(n) = A000040(n + A007652(n)).

A290630 a(n+1) = a(n) + (final digit of greatest prime < a(n)); a(1)=3.

Original entry on oeis.org

3, 5, 8, 15, 18, 25, 28, 31, 40, 47, 50, 57, 60, 69, 76, 79, 82, 91, 100, 107, 110, 119, 122, 125, 128, 135, 136, 137, 138, 145, 154, 155, 156, 157, 158, 165, 168, 175, 178, 181, 190, 191, 192, 193, 194, 197, 200, 209, 218, 219, 220, 221, 222, 223, 224, 227, 230, 239, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252
Offset: 1

Views

Author

David James Sycamore, Aug 07 2017

Keywords

Comments

Let a(n) be composite, and gp(n) be the greatest prime less than a(n), with final digit d(n). Then sp(n), the smallest prime greater than a(n) is in the sequence if and only if d(n) divides (sp(n) - a(n)), in which case (sp(n) - a(n))/d(n) is the integer m, and a(n + m) = sp(n).
If a(n) is prime, with final digit d'(n) then sp(n) (the next prime after a(n)) is in the sequence if and only if sp(n) = a(n)+ d(n) + r * d'(n) for some r >= 1, in which case
a(n + r + 1) = sp(n).
Primes appearing in the sequence are 3, 5, 31, 47, 79, 107, 137, 157, 181, 191, 193, 197, ... If a prime occurs at a(n), a(n+2) = a(n+1) + d(n) only if there is no prime between a(n) and a(n+1).
Primes in the sequence whose final digit is not contributed to a subsequent term include 3, 5, 31, 107, 197, ...
Primes not appearing in the sequence but which contribute a final digit include 2, 7, 13, 17, 23, 29, 37, ...

Examples

			a(2) = a(1) + gp(1) = 3 + 2 = 5.
a(59) = 242 (composite), gp(59) = 241, and d(59) = 1. sp(59) = 251 is in the sequence because (sp(59) - a(59))/d(59) = (251 - 242)/1 = 9 (= m). Therefore a(59 + 9) = a(68) = 251.
a(40) = 181 (prime), d'(40) = 1, gp(40) = 179, d(40) = 9. Then sp(40) = 191 is in the sequence because with r = 1,
a(40) + d(40) + r*d'(40) = 181 + 9 + 1*1 = 191 = a(40+1+1) = a(42).
		

Crossrefs

Programs

  • Maple
    A[1]:= 3:
    for i from 2 to 100 do
      A[i]:= A[i-1] + (prevprime(A[i-1]) mod 10)
    od:
    seq(A[i],i=1..100); # Robert Israel, Aug 13 2019
  • Mathematica
    NestList[# + Mod[NextPrime[#, -1], 10] &, 3, 68] (* Michael De Vlieger, Aug 19 2017 *)
  • PARI
    lista(nn) = {print1(a = 3, ", "); for (n=2, nn, a = a + precprime(a-1) % 10; print1(a, ", "););} \\ Michel Marcus, Aug 19 2017

Formula

a(n+1) = a(n) + d(n) where d(n) = A007652(gp(n)); gp(n) = greatest prime < a(n).

A302660 a(n) = (prime(n) mod 9) + (prime(n) mod 10).

Original entry on oeis.org

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

Views

Author

Dimitris Valianatos, Apr 11 2018

Keywords

Comments

The sum (prime(n) mod 9 + prime(n) mod 10) gives numbers between 2 and 17.
For large n the distribution is displayed in the diagram below.
.
^
|
3y| .. . . . . . . . . .. o o
| /:\ /:\
| / : \ / : \
2y| .. . . . . . o / : o--o : \ o
| /:\ / : : : : \ /:\
| / | \ / : | | : \ / | \
y| .. o--o--o : o--o : : : : o--o : o--o--o
| /. . . | . . : | | : . . | . . .\
| / . . . : . . : : : : . . : . . . \
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 /
.
If y is the quantity for {2, 3, 4, 6, 7, 12, 13, 15, 16, 17} (same)
then 2y is the quantity of {5, 9, 10, 14} (same) and
3y is the quantity for {8, 11} (same).
Example: For primes less than 10^10, the distribution of frequencies of a(n) from 2 to 17 is {18960677, 18960726, 18960712, 37920181, 18959991, 18960427, 56880630, 37923467, 37921201, 56882003, 18960991, 18960869, 37920879, 18960270, 18959802, 18959685}.

Examples

			For n=7, prime(7) = 17, 17 mod 9 = 8 and 17 mod 10 = 7. So a(7) = 8 + 7 = 15.
		

Crossrefs

Programs

  • Magma
    [(NthPrime(n) mod 9) + (NthPrime(n) mod 10): n in [1..100]]; // Vincenzo Librandi, Jun 10 2018
  • Maple
    map(t -> (t mod 9)+(t mod 10), [seq(ithprime(i),i=1..100)]); # Robert Israel, Jun 10 2018
  • Mathematica
    Array[Mod[#, 9] + Mod[#, 10] &@ Prime@ # &, 95] (* Michael De Vlieger, Apr 21 2018 *)
  • PARI
    {forprime(n = 2, 1000, s = n%9 + n%10; print1(s", "))}
    

Formula

a(n) = A038194(n) + A007652(n).

A308572 a(n) = Fibonacci(2*prime(n)).

Original entry on oeis.org

3, 8, 55, 377, 17711, 121393, 5702887, 39088169, 1836311903, 591286729879, 4052739537881, 1304969544928657, 61305790721611591, 420196140727489673, 19740274219868223167, 6356306993006846248183, 2046711111473984623691759, 14028366653498915298923761, 4517090495650391871408712937
Offset: 1

Views

Author

Christopher Hohl, Jun 08 2019

Keywords

Comments

This sequence is noteworthy in light of the congruence relation shared by a(n) and prime(n). Namely, for n > 2, a(n) == prime(n) (mod 10). That is, the last digit of prime(n) is 'preserved' as the last digit of a(n). See A007652.
As well, extending the notion, one notes that for k == 1 (mod 4), Fibonacci(2^k * prime(n)) == prime(n) (mod 10).
For any prime number p, the Fibonacci number F_(2p) == -(2p/5) (mod p), where -(2p/5) is the Legendre or Jacobi symbol. - Yike Li, Aug 30 2022

Examples

			a(4) = 377, because prime(4) = 7, 2*7 = 14, and Fibonacci(14) is 377.
		

Crossrefs

Programs

  • Maple
    f:= n -> combinat:-fibonacci(2*ithprime(n)):
    map(f, [$1..30]); # Robert Israel, Oct 23 2019
  • PARI
    a(n) = fibonacci(2*prime(n)); \\ Michel Marcus, Jun 08 2019

Formula

a(n) = A000045(A100484(n)). - Michel Marcus, Jun 08 2019

Extensions

More terms from Michel Marcus, Jun 08 2019

A354590 a(n) is the first prime that is the start of a sequence of exactly n consecutive primes that are in A354589.

Original entry on oeis.org

11, 47, 251, 9431, 191, 19457, 280627, 2213, 1006253, 9129563, 66945301, 184171621, 726512053, 2732087209, 10206934519, 59883612989, 25650350371
Offset: 1

Views

Author

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

Keywords

Examples

			a(3) = 251 because the 4 primes starting with 251 are 251, 257, 263, 269, and 251, 257 and 263 are in A354589 but 269 is not; and 251 is the least prime for which this works.
		

Crossrefs

Programs

  • Maple
    P:= select(isprime, [seq(i,i=1..10^7,2)]):
    nP:= nops(P);
    P10:= P mod 10:
    s:= 0: V:= Vector(10):
    for i from 1 to nP-3 do
      if convert(P10[i..i+3],set) = {1,3,7,9} then s:= s+1
      else
        if s > 0 and s <= 10 and V[s] = 0 then V[s]:= P[i-s] fi;
        s:= 0
      fi
    od:
    convert(V, list);

Extensions

a(11)-a(14) from Michael S. Branicky, Aug 18 2022
a(15)-a(17) from Michael S. Branicky, Aug 20 2022

A381869 Smallest starting prime for which the sum of 2*n consecutive primes is 0 modulo 10, or -1 if no such prime exists.

Original entry on oeis.org

13, 11, 7, 7, 13, 17, 7, 17, 37, 3, 7, 41, 7, 7, 11, 11, 11, 11, 11, 13, 11, 13, 11, 7, 7, 17, 7, 43, 41, 3, 3, 13, 11, 7, 13, 19, 7, 11, 11, 29, 7, 43, 3, 7, 11, 13, 23, 29, 3, 7, 7, 11, 11, 11, 19, 13, 5, 5, 13, 37, 17, 3, 3, 7, 17, 17, 3, 11, 19, 13, 3, 7, 23
Offset: 1

Views

Author

Jean-Marc Rebert, Mar 09 2025

Keywords

Examples

			a(1) = 13, because 13 and 17 are 2*1 = 2 consecutive primes such that 13 + 17 = 20 and 20 modulo 10 = 0, and no smaller prime has this property.
		

Crossrefs

Programs

  • Maple
    P:= select(isprime,[2,seq(i,i=3..10^6,2)]):
    S:= ListTools:-PartialSums(P):
    f:= proc(n) local j,t;
      for j from 1 do
        if S[2*n+j] - S[j] mod 10 = 0 then return P[j+1] fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, May 08 2025
  • Mathematica
    Do[i=1;Until[Mod[Total[Prime[Range[i,i+2*n-1]]],10]==0,i++];a[n]=Prime[i],{n,73}];Array[a,73] (* James C. McMahon, Mar 23 2025 *)
  • PARI
    isok(p, n) = my(i=primepi(p), q=prime(2*n+i-1)); vecsum(apply(x->Mod(x,10), primes([p, q]))) == 0;
    a(n) = my(p=3); while (!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, Mar 09 2025
    
  • Python
    from sympy import nextprime, prime, sieve
    def a(n):
        plst = list(sieve.primerange(3, prime(2*n+1)+1))
        s = sum(plst)
        while s%10:
            q = nextprime(plst[-1])
            s += (q-plst[0])
            plst = plst[1:] + [q]
        return plst[0]
    print([a(n) for n in range(1, 74)]) # Michael S. Branicky, Mar 09 2025
Previous Showing 41-50 of 59 results. Next