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-2 of 2 results.

A354972 Numbers k such that A354975(k) is prime.

Original entry on oeis.org

2, 9, 15, 19, 21, 32, 63, 75, 77, 108, 115, 120, 147, 151, 229, 235, 243, 248, 252, 258, 279, 283, 285, 288, 290, 299, 303, 309, 314, 352, 360, 361, 362, 377, 382, 387, 393, 398, 413, 418, 430, 447, 457, 462, 465, 467, 468, 470, 475, 488, 510, 518, 551, 560, 569, 604, 625, 643, 679, 732, 735, 740
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jun 15 2022

Keywords

Comments

Numbers k such that Sum_{i=1..k} (prime(i+k) mod prime(i)) is prime.

Examples

			a(1) = 2 is a term because A354975(2) = (5 mod 2) + (7 mod 3) = 2 is prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local k;
       isprime(add(ithprime(n+k) mod ithprime(k), k=1..n))
    end proc:
    select(filter, [$1..1000]);
  • PARI
    isok(k) = isprime(sum(i=1, k, prime(i+k) % prime(i))); \\ Michel Marcus, Jun 19 2022
    
  • Python
    from itertools import count, islice
    from sympy import prime, isprime
    def A354972_gen(): # generator of terms
        for n in count(1):
            if isprime(sum(prime(i+n) % prime(i) for i in range(1,n+1))):
                yield n
    A354972_list = list(islice(A354972_gen(),10)) # Chai Wah Wu, Jun 20 2022

A354975 a(n) = Sum_{i=1..n} (prime(i+n) mod prime(i)).

Original entry on oeis.org

1, 2, 6, 9, 16, 26, 25, 46, 47, 54, 81, 112, 140, 116, 173, 215, 254, 234, 317, 329, 409, 440, 511, 584, 581, 582, 666, 649, 776, 866, 875, 967, 1057, 1152, 1310, 1419, 1246, 1294, 1296, 1551, 1599, 1722, 1970, 2152, 2166, 2154, 2338, 2396, 2523, 2831, 3120, 2867, 3220, 3332, 3274, 3266, 3462
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jun 15 2022

Keywords

Examples

			For n = 3, a(n) = (7 mod 2) + (11 mod 3) + (13 mod 5) = 1+2+3 = 6.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
       add(ithprime(n+k) mod ithprime(k),k=1..n)
    end proc:
    map(f, [$1..100]);
  • Mathematica
    a[n_]:=Sum[Mod[Prime[i+n],Prime[i]],{i,n}]; Array[a,57] (* Stefano Spezia, Jun 15 2022 *)
  • PARI
    a(n) = sum(i=1, n, prime(i+n) % prime(i)); \\ Michel Marcus, Jun 15 2022
    
  • Python
    from sympy import prime
    def A354975(n): return sum(prime(i+n) % prime(i) for i in range(1,n+1)) # Chai Wah Wu, Jun 19 2022
Showing 1-2 of 2 results.