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.
0, 1, 2, 5, 7, 11, 12, 15, 21, 22, 25, 26, 35, 39, 40, 49, 51, 57, 67, 70, 77, 87, 92, 100, 117, 120, 123, 126, 145, 153, 155, 173, 176, 182, 186, 187, 205, 210, 214, 222, 228, 241, 247, 251, 260, 283, 287, 301, 319, 330, 345, 376, 382, 392, 425, 435, 442, 448
Offset: 0
Keywords
Examples
32 = 7 + 25; 195 = 22 + 173.
Links
- Andreas Enge, William Hart and Fredrik Johansson, Short addition sequences for theta functions, arXiv:1608.06810 [math.NT], 2016.
- Burkard Polster (Mathloger), The hardest 'What comes next?' (Euler's pentagonal formula), YouTube video, 2020.
Crossrefs
Programs
-
Maple
A355774_list := proc(upto) local P, k, issum, isgpn; P := []; isgpn := k -> ormap(n -> 0 = 8*k-(n+irem(n,2))*(3*n+2-irem(n,2)), [$0..k]); issum := k -> ormap(p -> member(k - p, P), P); for k from 0 to upto do if isgpn(k) or not issum(k) then P := [op(P), k] fi od; P end: print(A355774_list(448));
-
Mathematica
isgpn[k_] := AnyTrue[Range[0, k], 0 == 8*k-(#+Mod[#,2])*(3*#+2-Mod[#,2])&]; issum[k_] := AnyTrue[P, MemberQ[P, k-#]&]; P = {}; For[k = 0, k <= 448, k++, If[isgpn[k] || !issum[k], AppendTo[P, k]]]; P (* Jean-François Alcover, Mar 07 2024, after Peter Luschny *)
-
Python
def A355774_list(upto: int) -> list[int]: P: list[int] = [] for k in range(upto + 1): if any( k == ((n + n % 2) * (3 * n + 2 - n % 2)) >> 3 for n in range(k + 1) ) or not any([(k - p) in P for p in P]): P.append(k) return P print(A355774_list(448))
Comments