A059267 Numbers n with 2 divisors d1 and d2 having difference 2: d2 - d1 = 2; equivalently, numbers that are 0 (mod 4) or have a divisor d of the form d = m^2 - 1.
3, 4, 6, 8, 9, 12, 15, 16, 18, 20, 21, 24, 27, 28, 30, 32, 33, 35, 36, 39, 40, 42, 44, 45, 48, 51, 52, 54, 56, 57, 60, 63, 64, 66, 68, 69, 70, 72, 75, 76, 78, 80, 81, 84, 87, 88, 90, 92, 93, 96, 99, 100, 102, 104, 105, 108, 111, 112, 114, 116, 117, 120, 123, 124, 126, 128
Offset: 1
Keywords
Examples
a(18) = 35 because 5 and 7 divide 35 and 7 - 5 = 2.
Links
- M. F. Hasler, Table of n, a(n) for n = 1..3131
Programs
-
Maple
isA059267 := proc(n) local m ; if modp(n,4)=0 then true; else for m from 2 to ceil(sqrt(n)) do if modp(n,m^2-1) = 0 then return true ; end if; end do; false ; end if; end proc: for n from 1 to 130 do if isA059267(n) then printf("%d,",n) ; end if; end do:
-
Mathematica
d1d2Q[n_]:=Mod[n,4]==0||AnyTrue[Sqrt[#+1]&/@Divisors[n],IntegerQ]; Select[ Range[ 200],d1d2Q] (* Harvey P. Dale, May 31 2020 *)
-
PARI
isA059267(n)={ n%4==0 || fordiv( n,d, issquare(d+1) && return(1))} \\ M. F. Hasler, Aug 29 2008
-
PARI
is_A059267(n) = fordiv( n,d, n%(d+2)||return(1)) \\ M. F. Hasler, Jun 02 2012
Formula
A099475(a(n)) > 0. - Reinhard Zumkeller, Oct 18 2004
Extensions
More terms from James Sellers, Jan 24 2001
Removed comments linking to A143714, which seem wrong, as observed by Ignat Soroko, M. F. Hasler, Jun 02 2012
Comments