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.

A317240 Number of representations of n of the form 1 + p1 * (1 + p2* ... * (1 + p_j)...), where [p1, ..., p_j] is a (possibly empty) list of (not necessarily distinct) primes.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 0, 1, 2, 0, 2, 1, 2, 1, 3, 1, 1, 1, 1, 1, 2, 1, 2, 3, 2, 1, 4, 1, 3, 2, 0, 1, 2, 1, 3, 2, 1, 1, 3, 0, 2, 3, 2, 1, 3, 1, 3, 3, 1, 2, 4, 1, 2, 1, 3, 1, 2, 1, 2, 3, 2, 1, 3, 1, 4, 2, 2, 1, 3, 1, 4, 3, 2, 1, 5, 3, 3, 4, 0, 2, 2, 1, 3, 2, 2, 1, 5, 1, 3
Offset: 1

Views

Author

Alois P. Heinz, Jul 24 2018

Keywords

Examples

			a(13) = 2: 1 + 2 * (1 + 5) = 1 + 3 * (1 + 3) = 13.
a(31) = 3: 1 + 2 * (1 + 2 * (1 + 2 * (1 + 2))) = 1 + 3 * (1 + 3 * (1 + 2)) = 1 + 5 * (1 + 5) = 31.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 1,
          add(a((n-1)/p), p=numtheory[factorset](n-1)))
        end:
    seq(a(n), n=1..200);
  • Mathematica
    pp[n_] := pp[n] = FactorInteger[n][[All, 1]];
    q[n_] := q[n] = Switch[n, 1, True, 2, False, _, AnyTrue[pp[n-1], q[(n-1)/#]&]];
    a[n_] := a[n] = Which[n == 1, 1, !q[n], 0, True, Sum[a[(n-1)/p], {p, pp[n-1]}]];
    Array[a, 105] (* Jean-François Alcover, Jul 14 2021, after Alois P. Heinz *)

Formula

a(n) = Sum_{prime p|(n-1)} a((n-1)/p) for n>1, a(1) = 1.
a(n) = 0 <=> n in { A180337 }.
a(n) >= A317241(n).
G.f. A(x) satisfies: A(x) = x * (1 + A(x^2) + A(x^3) + A(x^5) + ... + A(x^prime(k)) + ...). - Ilya Gutkovskiy, May 09 2019

A317385 Smallest positive integer that has exactly n representations of the form 1 + p1 * (1 + p2* ... * (1 + p_j)...), where [p1, ..., p_j] is a (possibly empty) list of distinct primes.

Original entry on oeis.org

2, 1, 25, 43, 211, 638, 664, 1613, 2991, 7021, 11306, 9439, 17361, 23230, 40886, 38341, 49063, 36583, 99111, 111229, 110631, 171718, 233451, 255531, 309141, 327643, 369519, 521266, 489406, 738544, 682690, 812826, 1048594, 1015096, 2003002, 2118439, 1602360, 2204907, 2850772, 2702743, 2794198
Offset: 0

Views

Author

Alois P. Heinz, Jul 26 2018

Keywords

Examples

			a(1) = 1: 1.
a(2) = 25: 1 + 2 * (1 + 11) = 1 + 3 * (1 + 7) = 25.
a(3) = 43: 1 + 2 * (1 + 5 * (1 + 3)) = 1 + 3 * (1 + 13) = 1 + 7 * (1 + 5) = 43.
		

Crossrefs

Row n=1 of A317390.

Programs

  • Maple
    b:= proc(n, s) option remember; `if`(n=1, 1, add(b((n-1)/p
          , s union {p}), p=numtheory[factorset](n-1) minus s))
        end:
    a:= proc(n) option remember; local k;
          for k while n<>b(k, {}) do od; k
        end:
    seq(a(n), n=0..15);
  • Mathematica
    b[n_, s_] := b[n, s] = If[n == 1, 1, Sum[If[p == 1, 0, b[(n - 1)/p, s~Union~{p}]], {p, FactorInteger[n - 1][[All, 1]]~Complement~s}]];
    A[n_, k_] := Module[{h, p, q = 0}, p[_] = {}; While[Length[p[k]] < n, q++; h = b[q, {}]; p[h] = Append[p[h], q]]; p[k][[n]]];
    a[k_] := If[k == 0, 2, A[1, k]];
    Table[a[n], {n, 0, 15}] (* Jean-François Alcover, Jul 14 2021, after Alois P. Heinz in A317390 *)

Formula

a(n) = min { j > 0 : A317241(j) = n }.
Showing 1-2 of 2 results.