%I #43 Jun 22 2024 01:41:12
%S 1,32,200,528,1280,2744,4272,6592,10144,15048,19824,25824,34744,43520,
%T 55184,64680,80864,99184,115616,135144,157344,185872,207304,239600,
%U 272960,310240,351096,385392,433040,485528,531728,583696,646056,714800,779488,842928
%N Number of integer points (x, y, z, w) at distance <= 1/2 from 3-sphere of radius n.
%H Chai Wah Wu, <a href="/A350740/b350740.txt">Table of n, a(n) for n = 0..10000</a> (terms 0..200 from Robert Israel)
%F a(n) = A046895(n^2+n)-A046895(n^2-n) for n > 0. - _Chai Wah Wu_, Jun 21 2024
%p N:= 40: # for a(0)..a(N)
%p V:= Array(0..N):
%p for x from 0 to N do
%p for y from x to N do
%p for z from y to N do
%p for w from z to N do
%p S:= {x,y,z,w};
%p L:= [x,y,z,w];
%p m:= round(sqrt(x^2 + y^2 + z^2 + w^2));
%p if m > N then next fi;
%p f:= 4!/mul(numboccur(s,L)!, s = S) * 2^(4 - numboccur(0,[x,y,z,w]));
%p V[m]:= V[m] + f;
%p od od od od;
%p convert(V,list); # _Robert Israel_, Mar 08 2024
%o (Python)
%o from itertools import product
%o for R in range(100):
%o c = 0
%o for s in product(range(2*R + 1), repeat = 4):
%o if (2*R - 1)**2 <= 4*sum((i - R)**2 for i in s) <= (2*R + 1)**2: c += 1
%o print(c if R != 0 else 1, end = ', ')
%o (Python)
%o from itertools import combinations_with_replacement
%o from math import prod
%o from collections import Counter
%o def A350740(n):
%o if n == 0: return 1
%o x, y = (2*n-1)**2, (2*n+1)**2
%o return sum(24//prod((1,1,2,6,24)[d] for d in q.values())<<4-q[0] for q in map(Counter,combinations_with_replacement(range(n+1),4)) if x <= sum(b*a**2 for a, b in q.items())<<2 <= y) # _Chai Wah Wu_, Jun 20 2024
%o (Python)
%o # Uses Python code in A046895
%o def A350740(n): return A046895(n*(n+1))-A046895(n*(n-1)) if n else 1 # _Chai Wah Wu_, Jun 21 2024
%Y A 4-dimensional version of A016728.
%Y Cf. A046895.
%K nonn
%O 0,2
%A _Jeongseop Lee_, Jan 12 2022
|