A172432 Duplicate of A098952.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26
Offset: 0
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.
102 has three digits, 102 is divisible by 3, and 10 is also magic, so 102 is a member.
P1:={seq(i,i=1..9)}: for i from 2 to 25 do P||i:={}: for n from 1 to nops(P||(i-1)) do for j from 0 to 9 do if P||(i-1)[n]*10+j mod i = 0 then P||i:={op(P||i),P||(i-1)[n]*10+j}: fi: od: od: od: `union`({0},seq(P||i,i=1..25)); # Martin Renner, Mar 05 2016
divQ[n_]:=Divisible[n,IntegerLength[n]]; lessQ[n_]:=FromDigits[Most[IntegerDigits[n]]]; pdQ[n_]:=If[Or[n<10,And[divQ[n],divQ[lessQ[n]]]],True]; Select[Range[0,180],pdQ[#]&] (* Ivan N. Ianakiev, Aug 23 2016 *)
def agen(): # generator of terms yield 0 magic, biggermagic, digits = list(range(1, 10)), [], 2 while len(magic) > 0: yield from magic for i in magic: for d in range(10): t = 10*i + d if t%digits == 0: biggermagic.append(t) magic, biggermagic, digits = biggermagic, [], digits+1 print([an for an in agen()][:70]) # Michael S. Branicky, Feb 07 2022
100 has three digits and is not divisible by 3, therefore 100 is in the sequence.
[n: n in [1..140] | not IsIntegral(n/#Intseq(n))]; // Bruno Berselli, Feb 09 2016
Select[Range[150],!Divisible[#,IntegerLength[#]]&] (* Harvey P. Dale, Apr 24 2011 *)
def ok(n): return n%len(str(n)) print([k for k in range(142) if ok(k)]) # Michael S. Branicky, Feb 07 2022
105 is 1101001 in base 2 (length of 7); 105 / 7 is 15.
base_weight b g n | n == 0 = 0 | otherwise = (base_weight b g (n `div` b)) + (g $ n `mod` b) interesting b g = filter f [1..] where f n = n `mod` (base_weight b g n) == 0 bin_interesting g = interesting 2 g weights l n | (n >=0) && ((length l) > fromInteger n) = l !! fromInteger n | otherwise = 0 cnst = weights [1, 1] let sequence = bin_interesting cnst -- Victor S. Miller, Oct 17 2011
Select[Range[410], IntegerQ[#/Length[IntegerDigits[#, 2]]] &] (* Alonso del Arte, Dec 13 2010 *)
for(d=1, 9, forstep(n=(2^(d-1)+d-1)\d*d, 2^d-1, d, print1(n", "))) \\ Charles R Greathouse IV, Oct 17 2011
import math for n in range(1, 1000): if not n % int(math.log(n, 2) + 1): print(n) # Garcia
225 is in the sequence because it is a square divisible by 3.
Join[{0},Select[Range[200]^2,Divisible[#,IntegerLength[#]]&]] (* Harvey P. Dale, May 06 2015 *)
lista(nn) = {for (i=0, nn, if (issquare(i) && (i % #Str(i) == 0) , print1(i, ", ")););} \\ Michel Marcus, Jun 01 2013
2744 is in the sequence because it is a cube divisible by 4.
Join[{0},Select[Range[200]^3,Divisible[#,IntegerLength[#]]&]] (* Harvey P. Dale, Jan 28 2015 *)
lista(nn) = {for (i=0, nn, if (ispower(i, 3) && (i % #Str(i) == 0) , print1(i, ", ")););} \\ Michel Marcus, May 31 2013
Comments