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.

A218578 The number of times n occurs in A095972.

This page as a plain text file.
%I A218578 #31 Apr 28 2025 11:53:48
%S A218578 2,1,3,1,1,3,2,0,2,2,2,1,2,1,3,1,2,0,4,0,2,2,1,2,0,2,2,1,3,1,2,1,2,3,
%T A218578 0,1,2,2,1,1,2,1,2,0,3,1,2,1,2,0,4,1,2,3,2,0,2,1,2,0,2,1,0,2,0,3,3,0,
%U A218578 4,1,2,0,2,1,3,2,0,0,3,1,0,3,2,3,0,1,3
%N A218578 The number of times n occurs in A095972.
%C A218578 Alternative definition: a(n) = number of k such that A000224(k) = k - n.
%H A218578 T. D. Noe, <a href="/A218578/b218578.txt">Table of n, a(n) for n = 0..10000</a>
%e A218578 a(0) is 2, because 0 occurs only twice in A095972. a(1) is 1, because 1 occurs only once in A095972.
%p A218578 A218578 := proc(n)
%p A218578     local f;
%p A218578     f := 0 ;
%p A218578     for q from 1 to 2*n+2 do
%p A218578         if A095972(q) = n then
%p A218578             f := f+1 ;
%p A218578         end if;
%p A218578     end do:
%p A218578     f ;
%p A218578 end proc: # _R. J. Mathar_, Nov 05 2012
%t A218578 nn = 100; t = Table[Length[Complement[Range[n-1], Union[Mod[Range[n]^2, n]]]], {n, 2*nn + 2}]; Table[Count[t, n], {n, 0, nn}] (* _T. D. Noe_, Nov 06 2012 *)
%o A218578 (Python)
%o A218578 from math import prod
%o A218578 from sympy import factorint
%o A218578 def A218578(n): return sum(1 for i in range(1,2*n+3) if n==i-prod((p**(e+1)//((p+1)*(q:=1+(p==2)))>>1)+q for p, e in factorint(i).items())) # _Chai Wah Wu_, Oct 07 2024
%Y A218578 Cf. A000224, A095972, A218620 (greedy inverse).
%K A218578 nonn
%O A218578 0,1
%A A218578 _Dmitri Kamenetsky_, Nov 03 2012