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.

A165141 The least positive integer that can be written in exactly n ways as the sum of a square, a pentagonal number and a hexagonal number.

This page as a plain text file.
%I A165141 #39 Jul 22 2025 07:20:18
%S A165141 3,9,1,6,16,36,50,37,66,82,167,121,162,236,226,276,302,446,478,532,
%T A165141 457,586,677,521,666,852,976,877,1006,1046,1277,1381,1857,1556,1507,
%U A165141 1657,1832,1732,2336,2299,2007,2677,2326,2117,2591,2502,2516,2592,3106,3557
%N A165141 The least positive integer that can be written in exactly n ways as the sum of a square, a pentagonal number and a hexagonal number.
%C A165141 On Sep 04 2009, _Zhi-Wei Sun_ conjectured that the sequence A160324 contains every positive integer, i.e., for each positive integer n there exists a positive integer s which can be written in exactly n ways as the sum of a square, a pentagonal number and a hexagonal number. Based on this conjecture we create the current sequence. It seems that 0.9 < a(n)/n^2 < 1.6 for n > 33. _Zhi-Wei Sun_ conjectured that a(n)/n^2 has a limit c with 1.1 < c < 1.2. On Sun's request, his friend Qing-Hu Hou produced a list of a(n) for n = 1..913 (see the b-file).
%H A165141 Robert G. Wilson v, <a href="/A165141/b165141.txt">Table of n, a(n) for n = 1..2658</a>(terms 1..913 from Quig-Hu Hou)
%H A165141 F. Ge and Z. W. Sun, <a href="https://arxiv.org/abs/0906.2450">On some universal sums of generalized polygonal numbers</a>, preprint, arXiv:0906.2450 [math.NT], 2009-2016.
%H A165141 M. B. Nathanson, <a href="http://dx.doi.org/10.1090/S0002-9939-1987-0866422-3">A short proof of Cauchy's polygonal number theorem</a>, Proc. Amer. Math. Soc. 99(1987), 22-24.
%H A165141 Zhi-Wei Sun, <a href="https://listserv.nodak.edu/cgi-bin/wa.exe?A2=NMBRTHRY;53c19cb4.0908">A challenging conjecture on sums of polygonal number</a> (a message to Number Theory List), 2009.
%H A165141 Zhi-Wei Sun, <a href="http://math.nju.edu.cn/~zwsun/PolyNumber.pdf">Polygonal numbers, primes and ternary quadratic forms</a> (a talk given at a number theory conference), 2009.
%H A165141 Zhi-Wei Sun, <a href="http://math.nju.edu.cn/~zwsun/MSPT.htm">Mixed Sums of Primes and Other Terms</a> (a webpage).
%H A165141 Zhi-Wei Sun, <a href="http://arxiv.org/abs/0905.0635">On universal sums of polygonal numbers, preprint</a>, arXiv:0905.0635 [math.NT], 2009-2015.
%F A165141 a(n) = min{m>0: m=x^2+(3y^2-y)/2+(2z^2-z) has exactly n solutions with x,y,z=0,1,2,...}.
%e A165141 For n=5 the a(5)=16 solutions are 0^2+1+15 = 1^2+0+15 = 2^2+12+0 = 3^2+1+6 = 4^2+0+0 = 16.
%t A165141 SQ[x_] := x>-1 && IntegerPart[Sqrt[x]]^2==x;
%t A165141 RN[n_] := RN[n] = Sum[If[SQ[n - (3 y^2 - y)/2 - (2 z^2 - z)], 1, 0], {y, 0, (1 + Sqrt[1 + 24 n])/6}, {z, 0, (1 + Sqrt[8 (n - (3 y^2 - y)/2) + 1])/4}] (* iterators modified by _Robert G. Wilson v_, Apr 05 2025 *);
%t A165141 Do[Do[If[RN[m]==n,Print[n," ", m];Goto[aa]],{m,1,1000000}];Label[aa];Continue,{n,1,100}]
%t A165141 f = Compile[{{n, _Integer}}, Block[{cnt = 0, pentind, hex, hexind = Floor[(1 + Sqrt[8n +1])/4]}, While[ hexind > -1, hex = hexind (2 hexind - 1); pentind = Floor[(1 + Sqrt[1 + 24 (n - hex)])/6]; While[pentind > -1, If[ Floor[ Sqrt[ n - hex - pentind (3 pentind - 1)/2]]^2 == n - hex - pentind (3 pentind - 1)/2, cnt++]; pentind--]; hexind--]; cnt]]; t[_] := 0; k = 1; While[k < 100001, If[ t[f[k]] == 0, t[f[k]] = k]; k++]; t /@ Range@ 250 (* _Robert G. Wilson v_, Apr 04 2025 *)
%Y A165141 Cf. A160324, A000290, A000326, A000384, A160325, A160326.
%K A165141 nice,nonn
%O A165141 1,1
%A A165141 _Zhi-Wei Sun_, Sep 05 2009