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.
%I A355593 #42 Jan 06 2024 09:21:33 %S A355593 1,2,2,3,2,4,2,4,3,4,1,6,1,4,3,5,1,6,1,5,4,2,2,7,3,2,4,5,2,7,1,6,2,3, %T A355593 3,9,1,3,2,6,2,7,2,3,5,3,2,8,3,6,2,4,1,8,2,7,2,4,1,9,2,2,6,6,3,4,2,4, %U A355593 4,7,1,11,1,3,4,5,2,5,1,7,5,3,2,9,3,3,4,4,2,11,2,5,2,4,2,10,1,6,3,7 %N A355593 a(n) is the number of alternating integers that divide n. %C A355593 This sequence first differs from A355302 at index 13, where a(13) = 1 while A355302(13) = 2. %C A355593 This sequence first differs from A332268 at index 14, where a(14) = 4 while A332268(14) = 3. %H A355593 Robert Israel, <a href="/A355593/b355593.txt">Table of n, a(n) for n = 1..10000</a> %F A355593 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{n>=2} 1/A030141(n) = 5.1... (the sums up to 10^10, 10^11 and 10^12 are 5.1704..., 5.1727... and 5.1738..., respectively). - _Amiram Eldar_, Jan 06 2024 %e A355593 40 has 8 divisors: {1, 2, 4, 5, 8, 10, 20, 40} of which 2 are not alternating integers: {20, 40}, hence a(40) = 8 - 2 = 6. %p A355593 Alt:= [$1..9, seq(seq(10*i+r - (i mod 2), r=[1,3,5,7,9]),i=1..9)]: %p A355593 V:= Vector(100): %p A355593 for t in Alt do J:= [seq(i,i=t..100,t)]; V[J]:= V[J] +~ 1 od: %p A355593 convert(V,list); # _Robert Israel_, Nov 26 2023 %t A355593 q[n_] := !MemberQ[Differences[Mod[IntegerDigits[n], 2]], 0]; a[n_] := DivisorSum[n, 1 &, q[#] &]; Array[a, 120] (* _Amiram Eldar_, Jul 08 2022 *) %o A355593 (Python) %o A355593 from sympy import divisors %o A355593 def p(d): return 0 if d in "02468" else 1 %o A355593 def c(n): %o A355593 if n < 10: return True %o A355593 s = str(n) %o A355593 return all(p(s[i]) != p(s[i+1]) for i in range(len(s)-1)) %o A355593 def a(n): return sum(1 for d in divisors(n, generator=True) if c(d)) %o A355593 print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, Jul 08 2022 %o A355593 (PARI) alternate(n,d=digits(n))=for(i=2,#d, if((d[i]-d[i-1])%2==0, return(0))); 1 %o A355593 a(n)=sumdiv(n,d,alternate(d)) \\ _Charles R Greathouse IV_, Jul 08 2022 %Y A355593 Cf. A030141 (alternating integers), A355594, A355595, A355596. %Y A355593 Similar to A332268 (with Niven numbers) and A355302 (with undulating integers). %K A355593 nonn,base %O A355593 1,2 %A A355593 _Bernard Schott_, Jul 08 2022