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-3 of 3 results.

A093696 Numbers n such that all divisors of n have an odd number of 1's in their binary expansions.

Original entry on oeis.org

1, 2, 4, 7, 8, 11, 13, 14, 16, 19, 22, 26, 28, 31, 32, 37, 38, 41, 44, 47, 49, 52, 56, 59, 61, 62, 64, 67, 73, 74, 76, 79, 82, 88, 91, 94, 97, 98, 103, 104, 107, 109, 112, 118, 121, 122, 124, 127, 128, 131, 133, 134, 137, 143, 146, 148, 151, 152, 157, 158, 164, 167, 173
Offset: 1

Views

Author

Jason Earls, May 16 2004

Keywords

Comments

Subsequence of A000069. - Michel Marcus, Feb 09 2014
Numbers all of whose divisors are odious. - Bernard Schott, Jul 22 2022

Examples

			14 is in the sequence because its divisors are [1, 2, 7, 14] and in binary: 1, 10, 111 and 1110, all have an odd number of 1's.
		

Crossrefs

Similar sequences: A062687, A190217, A337741, A337941, A355596.
A000079 is a subsequence.

Programs

  • Maple
    isA001969 := proc(n)
        if wt(n) mod 2 = 0 then
            true;
        else
            false;
        end if;
    end proc:
    isA093696 := proc(n)
        for d in numtheory[divisors](n) do
            if isA001969(d) then
                return false;
            end if;
        end do;
        true;
    end proc:
    for n from 1 to 200 do
        if isA093696(n) then
            printf("%d,",n);
        end if;
    end do: # R. J. Mathar, Feb 13 2014
  • Mathematica
    odiousQ[n_] := OddQ @ DigitCount[n, 2][[1]]; Select[Range[200], AllTrue[ Divisors[#], odiousQ ] &] (* Amiram Eldar, Dec 09 2019 *)
  • PARI
    is(n)=fordiv(n,d,if(hammingweight(d)%2==0, return(0))); 1 \\ Charles R Greathouse IV, Mar 29 2013
    
  • Python
    from sympy import divisors, isprime
    def c(n): return bin(n).count("1")&1
    def ok(n): return n > 0 and all(c(d) for d in divisors(n, generator=True))
    print([k for k in range(174) if ok(k)]) # Michael S. Branicky, Jul 24 2022

Formula

{n: A356018(n) =0 }. - R. J. Mathar, Aug 07 2022

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
Showing 1-3 of 3 results.