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.

A197704 Integers divisible by their generalized weight.

This page as a plain text file.
%I A197704 #25 Mar 01 2024 02:04:52
%S A197704 13,18,42,60,100,115,120,145,272,279,310,319,341,372,403,434,465,480,
%T A197704 493,496,518,540,592,595,612,665,720,748,792,805,864,884,900,918,952,
%U A197704 1053,1080,1147,1200,1254,1287,1312,1320,1360,1440,1482,1520,1560,1591,1596
%N A197704 Integers divisible by their generalized weight.
%C A197704 The generalized weight of a binary number is obtained by assigning 1->3, 0->4, and summing up the weights of the digits (no leading zeros), for example 13 is in the sequence because it's 1101 in binary.
%t A197704 Select[Range[2000], IntegerQ[#/Plus@@(IntegerDigits[#, 2]/.{1 -> 3, 0 -> 4})] &] (* _Alonso del Arte_, Oct 17 2011 *)
%o A197704 (Haskell)
%o A197704 base_weight b g n | n == 0 = 0 | otherwise = (base_weight b g (n `div` b)) + (g $ n `mod` b)
%o A197704 interesting b g = filter f [1..] where f n = n `mod` (base_weight b g n) == 0
%o A197704 bin_interesting g = interesting 2 g
%o A197704 weights l n | (n >=0) && ((length l) > fromInteger n) = l !! fromInteger n | otherwise = 0
%o A197704 original = weights [4,3]
%o A197704 let a = bin_interesting original
%o A197704 (PARI) is(n)=my(v=binary(n));n%(#v<<2-sum(i=1,#v,v[i]))==0 \\ _Charles R Greathouse IV_, Oct 19 2011
%Y A197704 Cf. A177869 (same sort of sequence in which each digit gets weight 1).
%K A197704 nonn,base
%O A197704 1,1
%A A197704 _Victor S. Miller_, Oct 17 2011