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

A355595 Positions of records in A355593: Integers whose number of alternating divisors sets a new record.

Original entry on oeis.org

1, 2, 4, 6, 12, 24, 36, 72, 144, 180, 360, 504, 630, 1080, 1260, 1890, 2520, 3780, 7560, 15120, 18900, 22680, 30240, 37800, 45360, 75600, 90720, 151200, 162540, 226800, 317520, 325080, 650160, 763560, 1137780, 1243620, 1527120, 2275560, 3054240, 3738420, 4551120, 6826680, 7476840, 14953680, 17445960, 21818160, 26168940, 36363600, 43636320, 52337880
Offset: 1

Views

Author

Bernard Schott, Jul 08 2022

Keywords

Comments

Alternating integers are in A030141.
Corresponding records of number of alternating divisors are 1, 2, 3, 4, 6, 7, 9, 11, ...

Examples

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

Crossrefs

Similar, but with undulating divisors: A355304.

Programs

  • Mathematica
    q[n_] := ! MemberQ[Differences[Mod[IntegerDigits[n], 2]], 0]; f[n_] := DivisorSum[n, 1 &, q[#] &]; fm = 0; s = {}; Do[fn = f[n]; If[fn > fm, fm = fn; AppendTo[s, n]], {n, 1, 10^5}]; s (* Amiram Eldar, Jul 08 2022 *)

Extensions

a(21)-a(36) from Amiram Eldar, Jul 08 2022
a(37)-a(50) from Charles R Greathouse IV, 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

A355695 a(n) is the smallest number that has exactly n nonpalindromic divisors (A029742).

Original entry on oeis.org

1, 10, 20, 30, 48, 72, 60, 140, 144, 120, 210, 180, 300, 240, 560, 504, 360, 420, 780, 1764, 900, 960, 720, 1200, 840, 1560, 2640, 1260, 1440, 2400, 3900, 3024, 1680, 3120, 2880, 4800, 7056, 3600, 2520, 3780, 3360, 5460, 6480, 16848, 6300, 8820, 7200, 9240, 6720, 12480, 5040
Offset: 0

Views

Author

Bernard Schott, Jul 14 2022

Keywords

Examples

			48 has 10 divisors: {1, 2, 3, 4, 6, 8, 12, 16, 24, 48}, only 12, 16, 24 and 48 are nonpalindromic; no positive integer smaller than 48 has four nonpalindromic divisors, hence a(4) = 48.
		

Crossrefs

Similar sequences: A087997, A333456, A355303, A355594.

Programs

  • Mathematica
    f[n_] := DivisorSum[n, 1 &, ! PalindromeQ[#] &]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n] + 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[50, 10^5] (* Amiram Eldar, Jul 14 2022 *)
  • PARI
    isnp(n) = my(d=digits(n)); d!=Vecrev(d); \\ A029742
    a(n) = my(k=1); while (sumdiv(k, d, isnp(d)) != n, k++); k; \\ Michel Marcus, Jul 14 2022
    
  • Python
    from sympy import divisors
    from itertools import count, islice
    def c(n): s = str(n); return s != s[::-1]
    def f(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    def agen():
        n, adict = 0, dict()
        for k in count(1):
            fk = f(k)
            if fk not in adict: adict[fk] = k
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 51))) # Michael S. Branicky, Jul 27 2022

Extensions

More terms from Michel Marcus, Jul 14 2022

A357172 a(n) is the smallest integer that has exactly n divisors whose decimal digits are in strictly increasing order.

Original entry on oeis.org

1, 2, 4, 6, 16, 12, 54, 24, 36, 48, 72, 180, 144, 360, 336, 468, 504, 936, 1008, 1512, 2520, 3024, 5040, 6552, 7560, 22680, 13104, 19656, 49140, 105840, 39312, 78624, 98280, 248976, 334152, 196560, 393120, 668304, 1244880, 1670760, 1867320, 4520880, 3341520, 3734640
Offset: 1

Views

Author

Bernard Schott, Sep 16 2022

Keywords

Comments

This sequence is finite since A009993 is finite with 511 nonzero terms, hence the last term is a(511) = lcm of the 511 nonzero terms of A009993.
a(511) = 8222356410...6120992000 and has 1036 digits. - Michael S. Branicky, Sep 16 2022

Examples

			For n=7, the divisors of 54 are {1, 2, 3, 6, 9, 18, 27, 54} of which 7 have their digits in strictly increasing order (all except 54). No integer < 54 has 7 such divisors, so a(7) = 54.
		

Crossrefs

Similar: A087997 (palindromic), A355303 (undulating), A355594 (alternating).

Programs

  • Mathematica
    s[n_] := DivisorSum[n, 1 &, Less @@ IntegerDigits[#] &]; seq[len_, nmax_] := Module[{v = Table[0, {len}], n = 1, c = 0, i}, While[c < len && n < nmax, i = s[n]; If[i <= len && v[[i]] == 0, v[[i]] = n; c++]; n++]; v]; seq[25, 10^4] (* Amiram Eldar, Sep 16 2022 *)
  • PARI
    isok(d) = Set(d=digits(d)) == d; \\ A009993
    f(n) = sumdiv(n, d, isok(d)); \\ A357171
    a(n) = my(k=1); while (f(k) !=n, k++); k; \\ Michel Marcus, Sep 16 2022
    
  • Python
    from sympy import divisors
    from itertools import count, islice
    def c(n): s = str(n); return s == "".join(sorted(set(s)))
    def f(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    def agen():
        n, adict = 1, dict()
        for k in count(1):
            fk = f(k)
            if fk not in adict: adict[fk] = k
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 37))) # Michael S. Branicky, Sep 16 2022

Extensions

More terms from Amiram Eldar, Sep 16 2022
Showing 1-5 of 5 results.