login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the number of integers k of the form x^2 + x*y + y^2 (A003136) with n^2 < k < (n+1)^2.
5

%I #24 Jan 16 2024 14:08:13

%S 0,1,1,2,2,3,4,4,5,4,6,5,6,8,7,8,7,9,9,11,10,10,11,10,13,12,13,13,13,

%T 14,13,16,16,16,14,16,17,16,18,20,19,19,19,19,21,20,22,21,21,22,22,24,

%U 25,21,24,25,24,27,27,25,29,26,28,26,27,29,29,30,28,29,32,31

%N a(n) is the number of integers k of the form x^2 + x*y + y^2 (A003136) with n^2 < k < (n+1)^2.

%C a(n) is the number of circles centered at (0,0) that pass through grid points of the hexagonal lattice that intersect the interior of an interval n < x < n+1 on the x-axis.

%H Hugo Pfoertner, <a href="/A364443/b364443.txt">Table of n, a(n) for n = 0..10000</a>

%H IBM Research, <a href="https://research.ibm.com/haifa/ponderthis/challenges/December2023.html">Circles on a triangular grid</a>, Ponder This Challenge December 2023.

%H Hugo Pfoertner, <a href="http://www.randomwalk.de/sequences/a364443.txt">Table of n, a(n) for n = 0..500000</a>

%o (PARI) is_a003136(n) = !n || #qfbsolve(Qfb(1, 1, 1), n, 3);

%o for (k=0, 75, my (k1=k^2+1, k2=k^2+2*k, m=0); for (j=k1, k2, m+=is_a003136(j)); print1(m,", "))

%o (Python)

%o from sympy import factorint

%o def A364443(n): return sum(1 for k in range(n**2+1,(n+1)**2) if not any(e&1 for p, e in factorint(k).items() if p % 3 == 2)) # _Chai Wah Wu_, Aug 07 2023

%Y Cf. A002324, A004016, A077773, A357112, A364729, A364730, A364731, A364732.

%K nonn

%O 0,4

%A _Hugo Pfoertner_, Aug 05 2023