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.

A355774 An extension of the generalized pentagonal numbers such that every positive integer can be represented as the sum of at most two terms of the sequence.

This page as a plain text file.
%I A355774 #21 Mar 07 2024 08:02:31
%S A355774 0,1,2,5,7,11,12,15,21,22,25,26,35,39,40,49,51,57,67,70,77,87,92,100,
%T A355774 117,120,123,126,145,153,155,173,176,182,186,187,205,210,214,222,228,
%U A355774 241,247,251,260,283,287,301,319,330,345,376,382,392,425,435,442,448
%N A355774 An extension of the generalized pentagonal numbers such that every positive integer can be represented as the sum of at most two terms of the sequence.
%C A355774 The sequence is defined inductively. Starting from the empty sequence, the terms are added one after the other. A term is added if it is a generalized pentagonal number or if it cannot be represented as the sum of two preceding terms. Note that these exceptions form a proper subsequence of A093519.
%C A355774 Thus any positive number can be expressed as the sum of at most two positive terms by Euler's Pentagonal Number Theorem. Every pentagonal number and every generalized pentagonal number is in this sequence.
%H A355774 Andreas Enge, William Hart and Fredrik Johansson, <a href="https://arxiv.org/abs/1608.06810">Short addition sequences for theta functions</a>, arXiv:1608.06810 [math.NT], 2016.
%H A355774 Burkard Polster (Mathloger), <a href="https://www.youtube.com/watch?v=iJ8pnCO0nTY">The hardest 'What comes next?' (Euler's pentagonal formula)</a>, YouTube video, 2020.
%e A355774 32 = 7 + 25; 195 = 22 + 173.
%p A355774 A355774_list := proc(upto) local P, k, issum, isgpn; P := [];
%p A355774 isgpn := k -> ormap(n -> 0 = 8*k-(n+irem(n,2))*(3*n+2-irem(n,2)), [$0..k]);
%p A355774 issum := k -> ormap(p -> member(k - p, P), P);
%p A355774 for k from 0 to upto do
%p A355774     if isgpn(k) or not issum(k) then P := [op(P), k] fi od;
%p A355774 P end: print(A355774_list(448));
%t A355774 isgpn[k_] := AnyTrue[Range[0, k], 0 == 8*k-(#+Mod[#,2])*(3*#+2-Mod[#,2])&];
%t A355774 issum[k_] := AnyTrue[P, MemberQ[P, k-#]&];
%t A355774 P = {};
%t A355774 For[k = 0, k <= 448, k++, If[isgpn[k] || !issum[k], AppendTo[P, k]]];
%t A355774 P (* _Jean-François Alcover_, Mar 07 2024, after _Peter Luschny_ *)
%o A355774 (Python)
%o A355774 def A355774_list(upto: int) -> list[int]:
%o A355774     P: list[int] = []
%o A355774     for k in range(upto + 1):
%o A355774         if any(
%o A355774             k == ((n + n % 2) * (3 * n + 2 - n % 2)) >> 3
%o A355774             for n in range(k + 1)
%o A355774         ) or not any([(k - p) in P for p in P]):
%o A355774             P.append(k)
%o A355774     return P
%o A355774 print(A355774_list(448))
%Y A355774 Cf. A000326, A001318, A093519, A100878, A355717, A176747 (same construction with triangular numbers).
%K A355774 nonn
%O A355774 0,3
%A A355774 _Peter Luschny_, Jul 17 2022