login
A355594
a(n) is the smallest integer that has exactly n alternating divisors.
6
1, 2, 4, 6, 16, 12, 24, 48, 36, 96, 72, 144, 210, 180, 420, 360, 504, 864, 630, 1080, 1512, 2160, 1260, 3150, 1890, 2520, 5040, 6300, 3780, 10080, 12600, 9450, 7560, 32760, 15120, 18900, 22680, 30240, 88830, 37800, 45360, 75600, 105840, 90720, 151200, 162540, 254520
OFFSET
1,2
COMMENTS
This sequence first differs from A005179 at index 7 where A005179(7) = 64.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..147 (first 107 terms from Robert Israel)
David A. Corneth, Some upper bounds on a(n)
FORMULA
a(n) >= A005179(n). - David A. Corneth, Jan 25 2023
EXAMPLE
16 has 5 divisors: {1, 2, 4, 8, 16} all of which are alternating integers; no positive integer smaller than 16 has five alternating divisors, hence a(5) = 16.
96 has 12 divisors: {1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 96}, only 24 and 48 are not alternating; no positive integer smaller than 96 has ten alternating divisors, hence a(10) = 96.
MAPLE
isalt:= proc(n) local L; option remember;
L:= convert(n, base, 10) mod 2;
L:= L[2..-1]-L[1..-2];
not member(0, L)
end proc:
N:= 50: # for a(1)..a(N)
V:= Vector(N): count:= 0:
for n from 1 while count < N do
w:= nops(select(isalt, numtheory:-divisors(n)));
if w <= N and V[w] = 0 then V[w]:= n; count:= count+1 fi
od:
convert(V, list); # Robert Israel, Jan 24 2023
MATHEMATICA
q[n_] := ! MemberQ[Differences[Mod[IntegerDigits[n], 2]], 0]; f[n_] := DivisorSum[n, 1 &, q[#] &]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n]; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[50, 10^6] (* Amiram Eldar, Jul 08 2022 *)
PROG
(PARI) is(n, d=digits(n))=for(i=2, #d, if((d[i]-d[i-1])%2==0, return(0))); 1; \\ A030141
a(n) = my(k=1); while (sumdiv(k, d, is(d)) != n, k++); k; \\ Michel Marcus, Jul 11 2022
(Python)
from itertools import count
from sympy import divisors
def A355594(n):
for m in count(1):
if sum(1 for k in divisors(m, generator=True) if all(int(a)+int(b)&1 for a, b in zip(str(k), str(k)[1:]))) == n:
return m # Chai Wah Wu, Jul 12 2022
CROSSREFS
Cf. A005179, A030141 (alternating numbers), A355593, A355595, A355596.
Similar, but with undulating divisors: A355303.
Sequence in context: A209867 A136033 A343019 * A357172 A355303 A099315
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Jul 08 2022
EXTENSIONS
More terms from David A. Corneth, Jul 08 2022
STATUS
approved