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.

Previous Showing 11-12 of 12 results.

A256785 Numbers n such that digitsum(n) is a whole number when n is represented in the fractional base 1.5 = 3/2.

Original entry on oeis.org

1, 5, 11, 14, 20, 21, 22, 23, 26, 29, 30, 31, 33, 34, 38, 39, 40, 41, 45, 46, 51, 52, 53, 56, 57, 58, 60, 61, 65, 69, 70, 71, 74, 78, 79, 83, 84, 85, 87, 88, 89, 90, 91, 95, 101, 105, 106, 110, 111, 112, 113, 116, 117, 118, 122, 126, 127, 132, 133, 135, 136, 140, 146, 149, 155, 159, 160, 161, 164, 165, 166, 168, 169, 173, 174, 175
Offset: 1

Views

Author

Anthony Sand, Apr 10 2015

Keywords

Comments

Base 1.5 requires three digits: 1, 0 and H = 0.5. For example:
1 = 1 = 1 * 1.5^0
2 = 1H = 1 * 1.5^1 + 0.5 * 1.5^0 = 1.5 + 0.5
3 = 1H0 = 1 * 1.5^2 + 0.5 * 1.5^1 = 2.25 + 0.75
4 = 1H1 = 1 * 1.5^2 + 0.5 * 1.5^1 + 1 * 1.5^0 = 2.25 + 0.75 + 1
5 = 1H0H = 1 * 1.5^3 + 0.5 * 1.5^2 + 0.5 * 1.5^0 = 3.375 + 1.125 + 0.5
6 = 1H10 = 1 * 1.5^3 + 0.5 * 1.5^2 + 1 * 1.5^1 = 3.375 + 1.125 + 1.5
7 = 1H11 = 1 * 1.5^3 + 0.5 * 1.5^2 + 1 * 1.5^1 + 1 * 1.5^0 = 3.375 + 1.125 + 1.5 + 1
The sequence above lists the n for which digsum(n,base=1.5) is a whole number.

Examples

			The sequence begins with 1, 5 and 11, because:
digsum(1,b=1.5) = 1
digsum(5,b=1.5) = 2 = digsum(1H0H) = 1 + 0.5 + 0.5
digsum(11,b=1.5) = 4 = digsum(1H11H) = 1 + 0.5 + 1 + 1 + 0.5
The digsums are all whole numbers. However, 2, 3 and 4 are excluded because:
digsum(2,b=1.5) = 1.5 = digsum(1H) = 1 + 0.5
digsum(3,b=1.5) = 1.5 = digsum(1H0) = 1 + 0.5 + 0
digsum(4,b=1.5) = 2.5 = digsum(1H1) = 1 + 0.5 + 1
The digsums are not whole numbers.
		

Crossrefs

Programs

  • PARI
    { b=3/2; dmx=30; d=vector(dmx); nmx=1000; n=0; ni=0; while(ni0, di++; d[di]=nn-floor(nn/b)*b; nn\=b; ); s=0; for(i=1,di,s+=d[i]); if(floor(s)==s, ni++; write("digsum.txt",ni," ",n)); ); }

A358270 Numbers whose sum of digits is even and that have an even number of even digits.

Original entry on oeis.org

11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 1001, 1003, 1005, 1007, 1009, 1010, 1012, 1014, 1016, 1018, 1021, 1023, 1025, 1027, 1029, 1030
Offset: 1

Views

Author

Bernard Schott, Nov 06 2022

Keywords

Comments

There are only terms with an even number of digits, and precisely, there exist A137233(2*k) terms with 2*k digits.
The conditions separately are A054683 for even sum of digits, and A356929 for even number of even digits, so that this sequence is their intersection.
The opposite conditions, an odd sum of digits, and an odd number of odd digits, are the same and are A054684.

Examples

			26 is a term since 2+6 = 8 (even) and 26 has two even digits.
39 is a term since 3+9 = 12 (even) and 39 has zero even digits.
1012 is a term since 1+0+1+2 = 4 (even) and 1012 has two even digits.
		

Crossrefs

Intersection of A054683 and A356929.
Cf. A001637 (even length), A179081 (digit sum mod 2).

Programs

  • Mathematica
    Select[Range[1000], EvenQ[Plus @@ IntegerDigits[#]] && EvenQ[Plus @@ DigitCount[#, 10, Range[0, 8, 2]]] &] (* Amiram Eldar, Nov 06 2022 *)
  • PARI
    a(n) = n*=2; n += 100^logint(110*n,100) \ 11; n - sumdigits(n)%2; \\ Kevin Ryde, Nov 10 2022
  • Python
    def ok(n): s = str(n); return sum(map(int, s))%2 == sum(1 for d in s if d in "02468")%2 == 0
    print([k for k in range(1031) if ok(k)]) # Michael S. Branicky, Nov 06 2022
    
  • Python
    from itertools import count, islice, chain
    def A358270_gen(): # generator of terms
        return filter(lambda n:not (len(s:=str(n))&1 or sum(int(d) for d in s)&1), chain.from_iterable((range(10**l,10**(l+1)) for l in count(1,2))))
    A358270_list = list(islice(A358270_gen(),61)) # Chai Wah Wu, Nov 11 2022
    

Formula

a(n) = t - A179081(t) where t = A001637(2*n). - Kevin Ryde, Nov 10 2022
Previous Showing 11-12 of 12 results.