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.

A350740 Number of integer points (x, y, z, w) at distance <= 1/2 from 3-sphere of radius n.

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