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

A161973 Primes in A136251 in order of appearance.

Original entry on oeis.org

3, 7, 3, 7, 3, 5, 3, 5, 2, 7, 3, 3, 3, 3, 7, 5, 3, 13, 11, 3, 7, 3, 3, 5, 5, 13, 7, 5, 2, 11, 13, 2, 5, 17, 13, 7, 3, 7, 3, 7, 19, 7, 5, 3, 3, 13, 3, 7, 7, 3, 11, 3, 19, 11, 17, 3, 3, 5, 5, 5, 7, 5, 17, 5, 17, 7, 11, 19, 5, 17, 13, 19, 13, 11, 7, 3, 7, 2, 11, 3, 3, 3, 7, 13, 5, 3, 13, 2, 3, 7, 3, 11, 7
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 23 2009

Keywords

Examples

			The A136251(k) which are prime occur at k = 9, 10, 11, 12, 15, 16, 17, 18, ... and the subsequence of A136251 at these positions defines the sequence.
		

Crossrefs

Programs

  • Maple
    read("transforms") ; A007605 := proc(n) digsum(ithprime(n)) ; end:
    A136251 := proc(n) ithprime(n) mod A007605(n) ; end:
    for n from 1 to 300 do p := A136251(n); if isprime(p) then printf("%d,",p) ; fi; od: # R. J. Mathar, Aug 02 2009

Extensions

Edited, corrected and extended by R. J. Mathar, Aug 02 2009

A138792 Least prime, p, such that p mod (sum of the digits of p) = n.

Original entry on oeis.org

2, 11, 67, 23, 89, 53, 83, 29, 173, 19, 197, 193, 337, 167, 269, 79, 757, 397, 379, 479, 3677, 769, 997, 6967, 1699, 3889, 9857, 7867, 6959, 9949, 16987, 9887, 49697, 47599, 18899, 67979, 73999, 56999, 197699, 49999, 159899, 189989, 98899, 98999, 988877
Offset: 0

Views

Author

Robert G. Wilson v, Mar 28 2008

Keywords

Comments

First occurrence of n in A136251.

Examples

			a(2) = 67 = 13*5+2 <--> 67 (mod 13) = 2.
		

Crossrefs

Programs

  • Maple
    V:= Array(0..50): count:= 0: p:= 1:
    while count < 51 do
      p:= nextprime(p);
      s:= convert(convert(p,base,10),`+`);
      v:= p mod s;
      if v <= 50 and V[v] = 0 then V[v]:= p; count:= count+1;  fi
    od:
    convert(V,list); # Robert Israel, Mar 07 2023
  • Mathematica
    f[n_] := Block[{p = Prime@ n}, Mod[p, Plus @@ IntegerDigits@ p]]; t = Table[0, {1000}]; Do[ a = f@n; If[a < 1000 && t[[a + 1]] == 0, t[[a + 1]] = Prime@ n; Print[{a, Prime@n}]], {n, 503200000}]
    lp[n_]:=Module[{p=2},While[Mod[p,Total[IntegerDigits[p]]]!=n,p= NextPrime[ p]];p]; Array[lp,50,0] (* Harvey P. Dale, Jan 15 2019 *)
  • PARI
    a(n) = my(p=2); while ((p % sumdigits(p)) != n, p=nextprime(p+1)); p; \\ Michel Marcus, Mar 07 2023
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        adict, n, p = dict(), 0, 2
        while True:
            v = p%sum(map(int, str(p)))
            if v not in adict: adict[v] = p
            while n in adict: yield adict[n]; n += 1
            p = nextprime(p)
    print(list(islice(agen(), 45))) # Michael S. Branicky, Mar 07 2023

Extensions

Name corrected by Robert Israel, Mar 07 2023

A347702 Prime numbers that give a remainder of 1 when divided by the sum of their digits.

Original entry on oeis.org

11, 13, 17, 41, 43, 97, 101, 131, 157, 181, 233, 239, 271, 311, 353, 401, 421, 491, 521, 541, 599, 617, 631, 647, 673, 743, 811, 859, 953, 1021, 1031, 1051, 1093, 1171, 1201, 1249, 1259, 1301, 1303, 1327, 1373, 1531, 1601, 1621, 1801, 1871, 2029, 2111, 2129, 2161
Offset: 1

Views

Author

Burak Muslu, Sep 10 2021

Keywords

Examples

			97 is a term since its sum of digits is 9+7 = 16, and 97 mod 16 = 1.
		

Crossrefs

Subsequence of A209871.
A259866 \ {31}, and the primes associated with A056804 \ {1, 2} and A056797 are subsequences.

Programs

  • Maple
    select(t -> isprime(t) and t mod convert(convert(t,base,10),`+`) = 1, [seq(i,i=3..10000,2)]); # Robert Israel, Mar 05 2024
  • Mathematica
    Select[Range[2000], PrimeQ[#] && Mod[#, Plus @@ IntegerDigits[#]] == 1 &] (* Amiram Eldar, Sep 10 2021 *)
  • PARI
    isok(p) = isprime(p) && ((p % sumdigits(p)) == 1); \\ Michel Marcus, Sep 10 2021
  • Python
    from sympy import primerange
    def ok(p): return p%sum(map(int, str(p))) == 1
    print(list(filter(ok, primerange(1, 2130)))) # Michael S. Branicky, Sep 10 2021
    

A344127 Primes p such that (p mod s) and (p mod t) are consecutive primes, where s is the sum of the digits of p and t is the product of the digits of p.

Original entry on oeis.org

23, 29, 313, 397, 431, 661, 941, 1129, 1193, 1223, 1277, 1613, 2621, 2791, 3461, 4111, 4159, 12641, 12911, 14419, 15271, 19211, 21611, 21773, 22613, 26731, 29819, 31181, 31511, 41381, 61211, 74611, 111191, 115811, 121181, 121727, 141161, 141221, 141269, 145513, 157523, 171713, 173141, 173891
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, May 09 2021

Keywords

Comments

Since p mod 0 is not defined, the digit 0 is not allowed.

Examples

			a(3) = 313 is a term because with s = 3+1+3 = 7 and t = 3*1*3 = 9, 313 mod 7 = 5 and 313 mod 9 = 7 are consecutive primes.
		

Crossrefs

Programs

  • Maple
    filter:= proc(p) local L,s,t,q;
      L:= convert(p,base,10);
      s:= convert(L,`+`);
      t:= convert(L,`*`);
      if t = 0 then return false fi;
      q:= p mod s;
      isprime(q) and (p mod t) = nextprime(q)
    end proc:
    select(filter, [seq(ithprime(i),i=1..20000)]);
  • PARI
    isok(p) = if (isprime(p), my(d=digits(p)); vecmin(d) && isprime(q=(p%vecsum(d))) && isprime(r=(p%vecprod(d))) && (nextprime(q+1)==r)); \\ Michel Marcus, May 10 2021

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
Showing 1-5 of 5 results.