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

A317241 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 distinct primes.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 0, 0, 0, 2, 1, 0, 1, 0, 1, 0, 0, 2, 1, 1, 2, 2, 1, 3, 1, 1, 1, 0, 1, 2, 0, 2, 2, 1, 1, 1, 0, 0, 1, 1, 1, 3, 1, 0, 1, 1, 0, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 0, 1, 1, 0, 0, 1, 1, 2, 1, 2, 2, 2, 1, 3, 1, 1, 1, 0, 0, 2, 1, 1, 1, 1, 1, 2, 1, 1
Offset: 1

Views

Author

Alois P. Heinz, Jul 24 2018

Keywords

Examples

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

Crossrefs

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:= n-> b(n, {}):
    seq(a(n), n=1..200);
  • 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_] := b[n, {}];
    Array[a, 200] (* Jean-François Alcover, May 26 2019, after Alois P. Heinz *)

Formula

a(n) = 0 <=> n in { A317242 }.
a(n) <= A317240(n).

A317384 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 (not necessarily distinct) primes.

Original entry on oeis.org

2, 1, 13, 31, 43, 91, 111, 231, 175, 274, 351, 471, 703, 526, 463, 931, 823, 1723, 1579, 1279, 1903, 2083, 1791, 2143, 2227, 2443, 2671, 2781, 2335, 3807, 3163, 3631, 3199, 4243, 5314, 5482, 5107, 4671, 6231, 6681, 8863, 7483, 6111, 6331, 7879, 8031, 8023, 9351
Offset: 0

Views

Author

Alois P. Heinz, Jul 26 2018

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, 1,
          add(b((n-1)/p), p=numtheory[factorset](n-1)))
        end:
    a:= proc(n) option remember; local k;
          for k while n<>b(k) do od; k
        end:
    seq(a(n), n=0..50);
  • 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)/#]&]];
    b[n_] := b[n] = Which[n == 1, 1, ! q[n], 0, True, Sum[b[(n-1)/p], {p, pp[n-1]}]];
    a[n_] := Module[{k}, For[k = 1, True, k++, If[n == b[k], Return[k]]]];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Dec 07 2023, after Alois P. Heinz *)

Formula

a(n) = min { j > 0 : A317240(j) = n }.

A180337 Numbers which cannot be expressed as a sum 1 + p1 + p1*p2 + p1*p2*p3 + ... for some collection of primes {p1, p2, p3, ...}.

Original entry on oeis.org

2, 5, 11, 23, 26, 47, 56, 95, 116, 122, 236, 254, 518, 530, 1082, 2210
Offset: 1

Views

Author

Jack W Grahl, Aug 28 2010

Keywords

Comments

I conjecture, but have not been able to prove, that this sequence is finite with only the terms given above. In that case it can be constructed by taking a1=2, and adjoining all numbers aj*ak + 1, where aj and ak are two prime members of the sequence.
Any number which can be expressed as p*q + 1, where p is prime and q does not belong to the sequence, does not belong to the sequence either.

Examples

			8 is not a member of the sequence since it is equal to 1 + 7.
9 is not a member of the sequence since it can be written 1 + 2 + 2*3.
10 is not a member of the sequence since it is equal to 1 + 3 + 3*2.
11 is a member of the sequence. If 11 could be written in this form, then p1 must divide 10. We would have 11 = 1 + p1(1 + p2 + ...), which would imply that 5 is not a member of the sequence if p1 = 2, or vice versa. Since both 2 nor 5 are members, so is 11.
		

Crossrefs

All terms given above belong to A009293.

Programs

  • Maple
    q:= proc(n) option remember; is(n=1 or ormap(p->
          q((n-1)/p), numtheory[factorset](n-1)))
        end:
    remove(q, [$1..3000])[];  # Alois P. Heinz, Jul 24 2018
  • Mathematica
    q[1] = True; q[2] = False;
    q[n_] := q[n] = AnyTrue[FactorInteger[n-1][[All, 1]], q[(n-1)/#]&];
    Select[Range[3000], !q[#]&] (* Jean-François Alcover, Nov 11 2020, after Alois P. Heinz *)
  • Perl
    #!/usr/bin/perl $max = 10; if (defined($ARGV[0])) { $max = $ARGV[0]; } $primes{1} = 0; $list{1} = 1; $list{2} = 0; print "2, "; foreach $k (2..$max){ $p = 1; $l = 0; foreach $j (1..$k) { if ($primes{$j}){ if (($k % $j) == 0){ $p = 0; if ($list{$k / $j}){ $l = 1; } } } } $primes{$k} = $p; $list{$k + 1} = $l || $p; if (!$list{$k + 1}){ $t = $k + 1; print "$t, " } }

Formula

A317240(a(n)) = 0. - Alois P. Heinz, Jul 24 2018

A380635 a(1) = 1; a(n+1) = Sum_{d^2|n} a(n/d^2).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 7, 7, 8, 8, 10, 10, 10, 10, 12, 13, 13, 14, 16, 16, 16, 16, 19, 19, 19, 19, 24, 24, 24, 24, 28, 28, 28, 28, 32, 34, 34, 34, 39, 40, 41, 41, 46, 46, 48, 48, 53, 53, 53, 53, 58, 58, 58, 60, 67, 67, 67, 67, 74, 74, 74, 74, 84, 84, 84, 85, 93, 93, 93, 93
Offset: 1

Views

Author

Ilya Gutkovskiy, Jan 28 2025

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; uses numtheory; `if`(n=1, 1,
          add(`if`(issqr(d), a((n-1)/d), 0), d=divisors(n-1)))
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Jan 28 2025
  • Mathematica
    a[1] = 1; a[n_] := a[n] = DivisorSum[n - 1, a[(n - 1)/#] &, IntegerQ[Sqrt[#]] &]; Table[a[n], {n, 1, 80}]
    nmax = 80; A[] = 0; Do[A[x] = x (1 + Sum[A[x^(k^2)], {k, 1, nmax}]) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x] // Rest

Formula

G.f. A(x) satisfies: A(x) = x * (1 + A(x) + A(x^4) + A(x^9) + ... + A(x^(k^2)) + ...).
Showing 1-4 of 4 results.