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.

A356374 a(n) is the first prime that starts a string of exactly n consecutive primes that are in A347702.

Original entry on oeis.org

131, 41, 11, 178909, 304290583, 8345111009
Offset: 1

Views

Author

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

Keywords

Comments

a(n) is the first prime that starts a string of exactly n consecutive primes that are quasi-Niven numbers, i.e., have remainder 1 when divided by the sum of their digits.
a(7) > 3*10^11, if it exists. - Amiram Eldar, Aug 04 2022

Examples

			a(3) = 11 because [11, 13, 17] is the first string of exactly 3 consecutive primes that are quasi-Niven numbers: 11 mod (1+1) = 1, 13 mod (1+3) = 1 and 17 mod (1+7) = 1, while the preceding prime 7 and the next prime 23 are not quasi-Niven.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) n mod convert(convert(n,base,10),`+`) = 1 end proc:
    V:= Vector(5): count:= 0:
    s:= 0: p:= 1:
    while count < 5 do
    p:= nextprime(p);
      if filter(p) then
        s:= s+1;
        if s = 1 then p0:= p fi
      elif s > 0 then
      if s <= 5 and V[s] = 0 then V[s]:= p0; count:= count+1 fi;
        s:= 0;
    fi
    od:
    convert(V,list);
  • Mathematica
    seq[len_, pmax_] := Module[{s = Table[0, {len}], v = {}, p = 2, c = 0, pfirst = 2, i}, While[c < len && p < pmax, If[Divisible[p - 1, Plus @@ IntegerDigits[p]], AppendTo[v, p]; If[pfirst == 0, pfirst = p], i = Length[v]; v = {}; If[0 < i <= len && s[[i]] == 0, s[[i]] = pfirst]; pfirst = 0]; p = NextPrime[p]]; s]; seq[4, 10^6] (* Amiram Eldar, Aug 04 2022 *)

Extensions

a(5)-a(6) from Amiram Eldar, Aug 04 2022

A136251 a(n) = n-th prime reduced modulo the sum of its digits.

Original entry on oeis.org

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

Views

Author

Odimar Fabeny, Mar 17 2008

Keywords

Comments

First occurrence of k: A138792. - Robert G. Wilson v, Mar 27 2008

Examples

			2 = 2*1 + 0
3 = 3*1 + 0
5 = 5*1 + 0
7 = 7*1 + 0
11 = 2*5 + 1 (the sum of the digits of 11 is equal to 2)
13 = 4*3 + 1
17 = 8*2 + 1
19 = 10*1 + 9
		

Crossrefs

Programs

  • Maple
    P := select(isprime, [2,seq(i,i=3..10^3,2)]):
    map(p -> p mod convert(convert(p,base,10),`+`), P); # Robert Israel, Mar 05 2024
  • Mathematica
    f[n_] := Block[{p = Prime@n}, Mod[p, Plus @@ IntegerDigits@p]]; Array[f, 97] (* Robert G. Wilson v, Mar 27 2008 *)
  • PARI
    a(n) = my(p=prime(n)); p % sumdigits(p); \\ Michel Marcus, Mar 07 2023

Formula

a(n) = A070635(A000040(n)). - Michel Marcus, Mar 07 2023

Extensions

More terms from Robert G. Wilson v, Mar 27 2008
Showing 1-2 of 2 results.