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

A317242 Positive integers having no representation 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, 5, 7, 11, 15, 23, 26, 27, 28, 31, 33, 35, 36, 47, 50, 56, 57, 63, 66, 78, 81, 82, 95, 96, 106, 116, 119, 120, 122, 129, 136, 156, 162, 166, 167, 190, 193, 215, 218, 219, 227, 236, 244, 254, 263, 286, 289, 330, 335, 342, 352, 359, 387, 393, 395, 396, 414
Offset: 1

Views

Author

Alois P. Heinz, Jul 24 2018

Keywords

Crossrefs

Column k=0 of A317390.
Cf. A180337 (subsequence), A317241.

Programs

  • Maple
    q:= proc(n, s) option remember; is (n=1 or ormap(p->
          q((n-1)/p, s union {p}), numtheory[factorset](n-1) minus s))
        end:
    a:= proc(n) option remember; local k; for k from
         `if`(n=1, 2, 1+a(n-1)) while q(k, {}) do od; k
        end:
    seq(a(n), n=1..100);
  • 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}]];
    Position[Array[b[#, {}]&, 10^5], 0] // Flatten (* Jean-François Alcover, Jul 14 2021, after Alois P. Heinz in A317241 *)

Formula

A317241(a(n)) = 0.
Showing 1-2 of 2 results.