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.

Showing 1-5 of 5 results.

A355593 a(n) is the number of alternating integers that divide n.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Bernard Schott, Jul 08 2022

Keywords

Comments

This sequence first differs from A355302 at index 13, where a(13) = 1 while A355302(13) = 2.
This sequence first differs from A332268 at index 14, where a(14) = 4 while A332268(14) = 3.

Examples

			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.
		

Crossrefs

Cf. A030141 (alternating integers), A355594, A355595, A355596.
Similar to A332268 (with Niven numbers) and A355302 (with undulating integers).

Programs

  • Maple
    Alt:= [$1..9, seq(seq(10*i+r - (i mod 2), r=[1,3,5,7,9]),i=1..9)]:
    V:= Vector(100):
    for t in Alt do J:= [seq(i,i=t..100,t)]; V[J]:= V[J] +~ 1 od:
    convert(V,list); # Robert Israel, Nov 26 2023
  • Mathematica
    q[n_] := !MemberQ[Differences[Mod[IntegerDigits[n], 2]], 0]; a[n_] := DivisorSum[n, 1 &, q[#] &]; Array[a, 120] (* Amiram Eldar, Jul 08 2022 *)
  • PARI
    alternate(n,d=digits(n))=for(i=2,#d, if((d[i]-d[i-1])%2==0, return(0))); 1
    a(n)=sumdiv(n,d,alternate(d)) \\ Charles R Greathouse IV, Jul 08 2022
  • Python
    from sympy import divisors
    def p(d): return 0 if d in "02468" else 1
    def c(n):
        if n < 10: return True
        s = str(n)
        return all(p(s[i]) != p(s[i+1]) for i in range(len(s)-1))
    def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jul 08 2022
    

Formula

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

A355594 a(n) is the smallest integer that has exactly n alternating divisors.

Original entry on oeis.org

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

Views

Author

Bernard Schott, Jul 08 2022

Keywords

Comments

This sequence first differs from A005179 at index 7 where A005179(7) = 64.

Examples

			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.
		

Crossrefs

Cf. A005179, A030141 (alternating numbers), A355593, A355595, A355596.
Similar, but with undulating divisors: A355303.

Programs

  • 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 *)
  • 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

Formula

a(n) >= A005179(n). - David A. Corneth, Jan 25 2023

Extensions

More terms from David A. Corneth, Jul 08 2022

A355596 Numbers all of whose divisors are alternating numbers (A030141).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 21, 23, 25, 27, 29, 32, 36, 41, 43, 47, 49, 50, 54, 58, 61, 63, 67, 69, 81, 83, 87, 89, 94, 98, 101, 103, 107, 109, 123, 125, 127, 129, 141, 145, 147, 149, 161, 163, 167, 181, 183, 189, 214, 218, 250, 254, 290, 298
Offset: 1

Views

Author

Bernard Schott, Jul 12 2022

Keywords

Comments

The smallest alternating number that is not a term is 30, because of 15.

Examples

			32 is a term since all the divisors of 32, i.e., 1, 2, 4, 8, 16 and 32, are alternating numbers
		

Crossrefs

Subsequence of A030141.
Similar sequences: A062687, A190217, A329419, A337941.

Programs

  • Mathematica
    q[n_] := AllTrue[Divisors[n], !MemberQ[Differences[Mod[IntegerDigits[#], 2]], 0] &]; Select[Range[300], q] (* Amiram Eldar, Jul 12 2022 *)
  • PARI
    isokd(n, d=digits(n))=for(i=2, #d, if((d[i]-d[i-1])%2==0, return(0))); 1; \\ A030141
    isok(m) = sumdiv(m, d, isokd(d)) == numdiv(m); \\ Michel Marcus, Jul 12 2022
  • Python
    from sympy import divisors
    def p(d): return 0 if d in "02468" else 1
    def c(n):
        if n < 10: return True
        s = str(n)
        return all(p(s[i]) != p(s[i+1]) for i in range(len(s)-1))
    def ok(n):
        return c(n) and all(c(d) for d in divisors(n, generator=True))
    print([k for k in range(1, 200) if ok(k)]) # Michael S. Branicky, Jul 12 2022
    

Extensions

a(51) and beyond from Michael S. Branicky, Jul 12 2022

A357173 Positions of records in A357171, i.e., integers whose number of divisors whose decimal digits are in strictly increasing order sets a new record.

Original entry on oeis.org

1, 2, 4, 6, 12, 24, 36, 48, 72, 144, 336, 468, 504, 936, 1008, 1512, 2520, 3024, 5040, 6552, 7560, 13104, 19656, 39312, 78624, 98280, 196560, 393120, 668304, 1244880, 1670760, 1867320, 3341520, 3734640, 7469280, 22407840, 26142480, 31744440, 52284960, 63488880
Offset: 1

Views

Author

Bernard Schott, Sep 17 2022

Keywords

Comments

As A009993 is finite, this sequence is necessarily finite.
Corresponding records are 1, 2, 3, 4, 6, 8, 9, 10, 11, ...

Examples

			a(6) = 24 is in the sequence because A357171(24) = 8 is larger than any earlier value in A357171.
		

Crossrefs

Similar sequences: A093036, A340548, A355595.

Programs

  • Mathematica
    s[n_] := DivisorSum[n, 1 &, Less @@ IntegerDigits[#] &]; seq = {}; sm = 0; Do[If[(sn = s[n]) > sm, sm = sn; AppendTo[seq, n]], {n, 1, 10^4}]; seq (* Amiram Eldar, Sep 17 2022 *)
  • PARI
    isok(d) = Set(d=digits(d)) == d; \\ A009993
    f(n) = sumdiv(n, d, isok(d)); \\ A357171
    lista(nn) = my(r=0, list = List()); for (k=1, nn, my(m=f(k)); if (m>r, listput(list, k); r = m);); Vec(list); \\ Michel Marcus, Sep 18 2022

Extensions

More terms from Amiram Eldar, Sep 17 2022

A356179 Positions of records in A279497, i.e., integers whose number of pentagonal divisors sets a new record.

Original entry on oeis.org

1, 5, 35, 70, 210, 420, 2310, 4620, 18480, 32340, 60060, 120120, 240240, 720720, 1141140, 2042040, 4084080, 4564560, 13693680, 19399380, 38798760, 77597520, 232792560, 387987600
Offset: 1

Views

Author

Bernard Schott, Jul 28 2022

Keywords

Comments

The first fourteen terms are the same as A356132; then a(15) = 1141140 while A356132(15) = 1261260.
Corresponding records of number of pentagonal divisors are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, ...

Examples

			210 is in the sequence because A279497(210) = 5 is larger than any earlier value in A279497.
		

Crossrefs

Similar sequences: A046952, A093036, A350756, A355595.

Programs

  • Mathematica
    f[n_] := DivisorSum[n, 1 &, IntegerQ[(1 + Sqrt[1 + 24*#])/6] &]; fm = -1; s = {}; Do[If[(fn = f[n]) > fm, fm = fn; AppendTo[s, n]], {n, 1, 10^5}]; s (* Amiram Eldar, Jul 28 2022 *)
  • PARI
    lista(nn) = my(m=0); for (n=1, nn, my(new = sumdiv(n, d, ispolygonal(d, 5))); if (new > m, m = new; print1(n, ", "));); \\ Michel Marcus, Jul 28 2022

Extensions

a(23)-a(24) from David A. Corneth, Jul 28 2022
Showing 1-5 of 5 results.