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.

A160373 Smallest number m such that exactly n triples (p,q,r) of distinct primes exist with m=p*q+r.

Original entry on oeis.org

1, 11, 13, 23, 17, 37, 53, 62, 81, 99, 93, 105, 118, 122, 148, 152, 165, 166, 208, 224, 214, 225, 232, 250, 284, 285, 308, 314, 332, 346, 326, 382, 388, 400, 448, 476, 458, 494, 454, 518, 520, 478, 525, 530, 578, 598, 640, 602, 632, 716, 634, 740, 710, 692
Offset: 0

Views

Author

Reinhard Zumkeller, May 11 2009

Keywords

Comments

A100951(a(n)) = n and A100951(m) <> n for m < a(n);
a(42) = 525 seems to be the largest odd term.
Note that switching p and q does not make a different triple. - Robert Israel, Mar 09 2018

Examples

			A100951(37) = #{2*3+31,2*7+23,2*13+11,2*17+3,5*7+2} = 5.
		

Programs

  • Maple
    N:= 10^4: # to get terms before the first term > N
    Primes:= select(isprime, [2, seq(i,i=3..N,2)]):
    V:= Vector(N):
    for r in Primes do
      for j from 1 while Primes[j]^2 <= N do
        p:= Primes[j];
        if p = r then next fi;
        for k from j+1 while p*Primes[k]+r <= N do
          q:= Primes[k];
          if q = r then next fi;
          V[p*q+r]:= V[p*q+r]+1;
        od
      od
    od:
    mv:= max( V):
    F:= Vector(mv):
    for i from 1 to N do
      if V[i] > 0 and F[V[i]] = 0 then F[V[i]]:= i fi
    od:
    F0:= min(select(t -> F[t] = 0, [$1..max(V)])):
    1, seq(F[i],i=1..F0-1); # Robert Israel, Mar 09 2018
    N:= 10^4: # to get terms before the first term > N
    Primes:= select(isprime, [2, seq(i,i=3..N,2)]):
    V:= Vector(N):
    for r in Primes do
      for j from 1 while Primes[j]^2 <= N do
        p:= Primes[j];
        if p = r then next fi;
        for k from j+1 to nops(Primes) while p*Primes[k]+r <= N do
          q:= Primes[k];
          if q = r then next fi;
          V[p*q+r]:= V[p*q+r]+1;
        od
      od
    od:
    mv:= max( V):
    F:= Vector(mv):
    for i from 1 to N do
      if V[i] > 0 and F[V[i]] = 0 then F[V[i]]:= i fi
    od:
    F0:= min(select(t -> F[t] = 0, [$1..max(V)])):
    if F0 = infinity then F0:= mv fi:
    1, seq(F[i],i=1..F0-1); # Robert Israel, Mar 09 2018