[go: up one dir, main page]

login
Revision History for A351479 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Numbers whose sum of odd digits is twice the sum of even digits.
(history; published version)
#13 by N. J. A. Sloane at Sat Feb 12 13:43:16 EST 2022
STATUS

proposed

approved

#12 by Michael S. Branicky at Sat Feb 12 11:22:56 EST 2022
STATUS

editing

proposed

#11 by Michael S. Branicky at Sat Feb 12 11:22:54 EST 2022
COMMENTS

The sequence is closed under concatenation (if k and m are terms, so are k.m and m.k); permutation of a term's string of digits; and insertion of 0's within a term's string of digits. - Michael S. Branicky, Feb 12 2022

STATUS

proposed

editing

#10 by Michael S. Branicky at Sat Feb 12 11:12:07 EST 2022
STATUS

editing

proposed

#9 by Michael S. Branicky at Sat Feb 12 11:12:00 EST 2022
PROG

(Python)

def ok(n):

ds = list(map(int, str(n)))

return sum(d for d in ds if d%2==1) == 2*sum(d for d in ds if d%2==0)

print([k for k in range(1, 2173) if ok(k)]) # Michael S. Branicky, Feb 12 2022

STATUS

proposed

editing

#8 by Amiram Eldar at Sat Feb 12 07:14:42 EST 2022
STATUS

editing

proposed

Discussion
Sat Feb 12
07:17
Eric Angelini: Yep, thanks!
#7 by Amiram Eldar at Sat Feb 12 07:14:39 EST 2022
MATHEMATICA

Select[Range[2000], Plus @@ Select[IntegerDigits[#], OddQ] == 2 * Plus @@ Select[IntegerDigits[#], EvenQ] &] (* Amiram Eldar, Feb 12 2022 *)

STATUS

proposed

editing

#6 by Michel Marcus at Sat Feb 12 07:04:50 EST 2022
STATUS

editing

proposed

#5 by Michel Marcus at Sat Feb 12 07:04:43 EST 2022
EXAMPLE

a(1) = 123 and the whose sum of the odd digits (4) is twice the sum of the even digits (2);

a(2) = 132 and the whose sum of the odd digits (4) is twice the sum of the even digits (2);

a(3) = 147 and the whose sum of the odd digits (8) is twice the sum of the even digits (4);.

STATUS

proposed

editing

Discussion
Sat Feb 12
07:04
Michel Marcus: ok ?
#4 by Eric Angelini at Sat Feb 12 06:56:44 EST 2022
STATUS

editing

proposed