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.

A066452 Anti-phi(n).

This page as a plain text file.
%I A066452 #31 May 22 2025 10:21:34
%S A066452 1,1,2,1,4,1,4,4,3,2,8,3,7,7,9,2,8,5,10,10,8,6,19,6,12,9,9,8,22,9,12,
%T A066452 12,15,10,31,9,11,14,24,13,23,9,24,17,16,10,35,15,23,25,20,12,40,17,
%U A066452 34,21,18,14,37,17,24,25,41,20,39,14,31,34,33,18,42,16,32,37,41,18,44,25
%N A066452 Anti-phi(n).
%C A066452 anti-phi(n) = the number of integers < n that are not divisible by any anti-divisor of n.
%C A066452 The old definition given for this sequence was: anti-phi(n) = number of integers <= n that are coprime to the anti-divisors of n. However this does not match the entries.
%C A066452 See A066272 for definition of anti-divisor.
%H A066452 Nathaniel Johnston, <a href="/A066452/b066452.txt">Table of n, a(n) for n = 2..10000</a> [This replaces an earlier b-file computed by Diana Mecum]
%H A066452 Jon Perry, <a href="http://www.users.globalnet.co.uk/~perry/maths/antidivisorother2.htm">Anti-phi function</a> [Broken link]
%H A066452 Jon Perry, <a href="/A066272/a066272a.html">The Anti-divisor</a> [Cached copy]
%H A066452 Jon Perry, <a href="/A066272/a066272.html">The Anti-divisor: Even More Anti-Divisors</a> [Cached copy]
%e A066452 10 has anti-divisors 3,4,7. The numbers not divisible by any of 3,4,7 and less than 10 are 1,2,5. Therefore anti-phi(10)=3.
%p A066452 # needs antidivisors() as implemented in A066272
%p A066452 A066452 := proc(n)local ad,isad,j,k,totad:ad:=antidivisors(n):totad:=0:for j from 1 to n-1 do isad:=1:for k from 1 to nops(ad) do if(j mod ad[k]=0)then isad:=0:break: fi:od:totad:=totad+isad:od:return totad:end:
%p A066452 seq(A066452(n), n=2..50); # _Nathaniel Johnston_, Apr 20 2011
%o A066452 (Python)
%o A066452 def A066452(n):
%o A066452     return len([x for x in range(1,n) if all([x % d  for d in range(2,n) if (n % d) and (2*n) % d in [d-1,0,1]])]) # _Chai Wah Wu_, Aug 07 2014
%o A066452 (PARI) antidiv(n) = {my(v = []); for (k=2, n-1, if (abs((n % k) - k/2) < 1, v = concat(v, k));); v;}
%o A066452 a(n) = {my(vad = antidiv(n)); my(nbad = 0); for (j=1, n-1, isad = 1; for (k=1, #vad, if ((j % vad[k]) == 0, isad = 0; break); ); nbad += isad;); nbad;} \\ _Michel Marcus_, Feb 25 2016
%Y A066452 Cf. A058838, A066241.
%K A066452 nonn,easy
%O A066452 2,3
%A A066452 _Jon Perry_, Dec 29 2001
%E A066452 Better definition and more terms from _Diana L. Mecum_, Jul 01 2007